linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Andrew Duggan <aduggan@synaptics.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Christopher Heiny <cheiny@synaptics.com>,
	Stephen Chandler Paul <cpaul@redhat.com>,
	Vincent Huang <vincent.huang@tw.synaptics.com>,
	Chris Healy <cphealy@gmail.com>,
	Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Subject: [PATCH] Input: synaptics-rmi4: fix array_size.cocci warnings
Date: Wed, 10 Feb 2016 10:27:44 +0800	[thread overview]
Message-ID: <20160210022744.GA8648@lkp-nex05> (raw)
In-Reply-To: <1455068422-11916-1-git-send-email-aduggan@synaptics.com>

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@synaptics.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.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)
 {

      reply	other threads:[~2016-02-10  2:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10  2:27 [PATCH v4 01/10] Input: synaptics-rmi4: Add support for Synaptics RMI4 devices kbuild test robot
2016-02-10  1:40 ` Andrew Duggan
2016-02-10  2:27   ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160210022744.GA8648@lkp-nex05 \
    --to=lkp@intel.com \
    --cc=aduggan@synaptics.com \
    --cc=andrey.gusakov@cogentembedded.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=cheiny@synaptics.com \
    --cc=cpaul@redhat.com \
    --cc=cphealy@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=kbuild-all@01.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.huang@tw.synaptics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).