From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] Input: synaptics-rmi4: fix array_size.cocci warnings Date: Wed, 10 Feb 2016 10:27:44 +0800 Message-ID: <20160210022744.GA8648@lkp-nex05> References: <201602101040.KxxuxnZe%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mga14.intel.com ([192.55.52.115]:42140 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbcBJC35 (ORCPT ); Tue, 9 Feb 2016 21:29:57 -0500 Content-Disposition: inline In-Reply-To: <1455068422-11916-1-git-send-email-aduggan@synaptics.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org Cc: kbuild-all@01.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Duggan , Dmitry Torokhov , Linus Walleij , Jiri Kosina , Benjamin Tissoires , Christopher Heiny , Stephen Chandler Paul , Vincent Huang , Chris Healy , Andrey Gusakov 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 Signed-off-by: Fengguang Wu --- 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) {