From patchwork Thu May 18 19:07:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 9735077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33A19601A1 for ; Thu, 18 May 2017 19:08:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E73B289D2 for ; Thu, 18 May 2017 19:08:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23303289F3; Thu, 18 May 2017 19:08:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1801D289D2 for ; Thu, 18 May 2017 19:08:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755343AbdERTIY (ORCPT ); Thu, 18 May 2017 15:08:24 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:32806 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755121AbdERTIX (ORCPT ); Thu, 18 May 2017 15:08:23 -0400 Received: by mail-pf0-f181.google.com with SMTP id e193so28229603pfh.0 for ; Thu, 18 May 2017 12:08:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KRLaXwvMAfpeZsD7bwFua9Zq4YE6HV5urAiQ49EHD5k=; b=qInzwDI4+hYjUUXk5DTWsXCzpzngmxU+m4NLCQtWhz7btI9yarVPw7ooDbZWNNdieC 7zU4TttZ/+GfCmoUJ9WBt2fb8W56HxK355UdRQt2WK7SDeNGwOknzcoTiYbLdZgSrRRo 1aXaAeE7rgqI4mNwz7BctccmJjZExzxyntNhJ/scfv958Ub2FkcI6QUIA2uAHue4/20w 2NujDfkALpG+TnKq131dKmBfPaOgaC++XtnZgx6MlU9mNStIctWBy8m4WplxYRefFNcd 5SgzYcpY3QYyrxPZMfJ+cwSWoTZyLhf19fGwvqwvn7jfmEg9leRp4caiPGOq+XK4Bfek 0LTg== X-Gm-Message-State: AODbwcBfleaxRFLt3ijwKZb3lo0zDPn9Rlbc5FOvLg9KgzfmorihAqZK QrGbe7T0nCTNhPKR X-Received: by 10.98.65.216 with SMTP id g85mr6253193pfd.187.1495134502682; Thu, 18 May 2017 12:08:22 -0700 (PDT) Received: from mka.mtv.corp.google.com ([172.22.64.162]) by smtp.gmail.com with ESMTPSA id o89sm12088421pfj.88.2017.05.18.12.08.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 May 2017 12:08:22 -0700 (PDT) From: Matthias Kaehlcke To: Paul Moore , Stephen Smalley , Eric Paris , James Morris , "Serge E . Hallyn" Cc: selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Kaehlcke Subject: [PATCH] selinux: Mark array 'labeling_behaviors' as __maybe_unused Date: Thu, 18 May 2017 12:07:59 -0700 Message-Id: <20170518190759.28560-1-mka@chromium.org> X-Mailer: git-send-email 2.13.0.303.g4ebf302169-goog Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The array is only referenced in an ARRAY_SIZE() statement. Adding the attribute fixes the following warning when building with clang: security/selinux/hooks.c:338:20: error: variable 'labeling_behaviors' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] Signed-off-by: Matthias Kaehlcke --- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e67a526d1f30..450ff9f3161c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -400,7 +400,7 @@ static void superblock_free_security(struct super_block *sb) /* The file system's label must be initialized prior to use. */ -static const char *labeling_behaviors[7] = { +static const char * __maybe_unused labeling_behaviors[7] = { "uses xattr", "uses transition SIDs", "uses task SIDs",