From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756748AbcBJC37 (ORCPT ); Tue, 9 Feb 2016 21:29:59 -0500 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,424,1449561600"; d="scan'208";a="743408775" Date: Wed, 10 Feb 2016 10:27:44 +0800 From: kbuild test robot To: Andrew Duggan 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 Subject: [PATCH] Input: synaptics-rmi4: fix array_size.cocci warnings Message-ID: <20160210022744.GA8648@lkp-nex05> References: <201602101040.KxxuxnZe%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455068422-11916-1-git-send-email-aduggan@synaptics.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) {