linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: mark@fasheh.com, jlbec@evilplan.org
Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org,
	Anders Roxell <anders.roxell@linaro.org>
Subject: [PATCH] fs/ocfs2/dlmglue: lockdep_keys defined but not used
Date: Wed,  4 Jul 2018 11:53:18 +0200	[thread overview]
Message-ID: <20180704095318.19218-1-anders.roxell@linaro.org> (raw)

When CONFIG_DEBUG_LOCK_ALLOC isn't enabled lockdep_keys isn't used and
we get a warning:
fs/ocfs2/dlmglue.c:99:30: warning: ‘lockdep_keys’ defined but not used
    [-Wunused-variable]
 static struct lock_class_key lockdep_keys[OCFS2_NUM_LOCK_TYPES];
                              ^~~~~~~~~~~~
Adding __maybe_unused to the declaration hids the warning.

Fixes: 1cd75cdb8fbb ("ocfs2: make several functions and variables static (and some const)")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 fs/ocfs2/dlmglue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 040ddb6e7dab..160e0b224367 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -96,7 +96,7 @@ struct ocfs2_unblock_ctl {
 };
 
 /* Lockdep class keys */
-static struct lock_class_key lockdep_keys[OCFS2_NUM_LOCK_TYPES];
+static struct lock_class_key __maybe_unused lockdep_keys[OCFS2_NUM_LOCK_TYPES];
 
 static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
 					int new_level);
-- 
2.18.0


             reply	other threads:[~2018-07-04  9:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  9:53 Anders Roxell [this message]
2018-07-26  7:21 ` [PATCH] fs/ocfs2/dlmglue: lockdep_keys defined but not used Anders Roxell
2018-08-23 21:07 ` Geert Uytterhoeven
2018-08-24 13:07   ` Anders Roxell
2018-10-09 18:22     ` Borislav Petkov
2018-10-09 22:40       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180704095318.19218-1-anders.roxell@linaro.org \
    --to=anders.roxell@linaro.org \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).