From: Arnd Bergmann <arnd@arndb.de>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Oleg Drokin <green@linuxhacker.ru>,
Andreas Dilger <andreas.dilger@intel.com>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org
Subject: [PATCH] staging: lustre: remove unused variable warning
Date: Wed, 20 May 2015 00:07:27 +0200 [thread overview]
Message-ID: <2136146.9CXrNBx2Z1@wuerfel> (raw)
A recent patch to simplify the lustre large memory allocation
causes new warnings as an unintended side-effect:
lustre/lov/lov_request.c: In function 'lov_finish_set':
lustre/lov/lov_request.c:78:7: warning: unused variable 'len' [-Wunused-variable]
int len = set->set_oabufs * sizeof(*set->set_pga);
^
lustre/obdclass/acl.c: In function 'lustre_ext_acl_xattr_reduce_space':
lustre/obdclass/acl.c:123:6: warning: unused variable 'old_size' [-Wunused-variable]
int old_size = CFS_ACL_XATTR_SIZE(old_count, ext_acl_xattr);
^
The reason is that the 'size' argument to OBD_FREE_LARGE()
is never needed, which was previously hidden by the extra
abstractions.
This avoids the warnings by adding a cast to void, to tell
the compiler that the argument is intentionally unused.
A better fix is probably to remove the entire set of allocation
macros and open-code the normal kernel interface calls.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 99d56ff7c1c ("staging/lustre: Always try kmalloc first for OBD_ALLOC_LARGE")
diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 379266d6bcd9..c0136ee778e3 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -688,6 +688,7 @@ do { \
#define OBD_FREE_LARGE(ptr, size) \
do { \
+ (void)(size); \
kvfree(ptr); \
} while (0)
reply other threads:[~2015-05-19 22:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=2136146.9CXrNBx2Z1@wuerfel \
--to=arnd@arndb.de \
--cc=HPDD-discuss@ml01.01.org \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=green@linuxhacker.ru \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®