From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbbESWHp (ORCPT ); Tue, 19 May 2015 18:07:45 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:65388 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbbESWHl (ORCPT ); Tue, 19 May 2015 18:07:41 -0400 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Oleg Drokin , Andreas Dilger , 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 Message-ID: <2136146.9CXrNBx2Z1@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:arHT1FnuEEzXi/Mjn7azBfeADEI0T4+FxnckthYfCkdLrjq+ucQ 5k8tBTYcz04qlvh9bG3TX/b1ct/0fL4pdCr1SvkY7kUz8hSz56Ny1ZOwWCZvDys63ViPEeA kREe59pgnUpBiUQGWplRUJa0i4rAMefzQYB06Lmd+z7EV+woxAh0FH6OTTTvzwEZm5zd/+t xVVnLi1RtchDqLOmeWUhw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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)