Commit 7f804436 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging: lustre: remove unused variable warning

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: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 99d56ff7 ("staging/lustre: Always try kmalloc first for OBD_ALLOC_LARGE")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdd84a6f
...@@ -688,6 +688,7 @@ do { \ ...@@ -688,6 +688,7 @@ do { \
#define OBD_FREE_LARGE(ptr, size) \ #define OBD_FREE_LARGE(ptr, size) \
do { \ do { \
(void)(size); \
kvfree(ptr); \ kvfree(ptr); \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment