[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160210022744.GA8648@lkp-nex05>
Date: Wed, 10 Feb 2016 10:27:44 +0800
From: kbuild test robot <lkp@...el.com>
To: Andrew Duggan <aduggan@...aptics.com>
Cc: kbuild-all@...org, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org,
Andrew Duggan <aduggan@...aptics.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Christopher Heiny <cheiny@...aptics.com>,
Stephen Chandler Paul <cpaul@...hat.com>,
Vincent Huang <vincent.huang@...synaptics.com>,
Chris Healy <cphealy@...il.com>,
Andrey Gusakov <andrey.gusakov@...entembedded.com>
Subject: [PATCH] Input: synaptics-rmi4: fix array_size.cocci warnings
drivers/input/rmi4/rmi_bus.c:295:20-21: WARNING: Use ARRAY_SIZE
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element
Semantic patch information:
This makes an effort to find cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE.
Generated by: scripts/coccinelle/misc/array_size.cocci
CC: Andrew Duggan <aduggan@...aptics.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
rmi_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -292,7 +292,7 @@ static struct rmi_function_handler *fn_h
};
#define RMI_FN_HANDLER_ARRAY_SIZE \
- (sizeof(fn_handlers) / sizeof(struct rmi_function_handler *))
+ ARRAY_SIZE(fn_handlers)
static void __rmi_unregister_function_handlers(int start_idx)
{
Powered by blists - more mailing lists