From patchwork Wed Feb 10 02:27:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 8267951 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 00ECD9F38B for ; Wed, 10 Feb 2016 02:30:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30D2320270 for ; Wed, 10 Feb 2016 02:30:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F1B0202B8 for ; Wed, 10 Feb 2016 02:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755157AbcBJC36 (ORCPT ); Tue, 9 Feb 2016 21:29:58 -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 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 09 Feb 2016 18:29:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,424,1449561600"; d="scan'208";a="743408775" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2016 18:29:55 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1aTKXM-0008d7-Dy; Wed, 10 Feb 2016 10:29:48 +0800 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-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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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) {