linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Drebes <lists-receive@programmierforen.de>
To: dmitry.torokhov@gmail.com,
	linux-joystick@atrey.karlin.mff.cuni.cz,
	linux-input@atrey.karlin.mff.cuni.cz,
	kernel-janitors@lists.osdl.org
Subject: [PATCH] [trivial] drivers/input/joystick/grip_mp.c: ARRAY_SIZE
Date: Wed, 6 Jun 2007 22:10:10 +0200	[thread overview]
Message-ID: <200706062210.11555.lists-receive@programmierforen.de> (raw)

This patch replaces an array size calculation in drivers/input/joystick/grip_mp.c
that was done using sizeof with the ARRAY_SIZE macro. To be more specific,
I replaced a variable called seq_len in the function dig_mode_start that stored
the size of the array with ARRAY_SIZE. The variable was referenced only once,
so I think removing it is ok.

Tested by compilation on an i386 box using "allyesconfig".
Diffed against Linus' git-tree.

Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
---
diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
index 555319e..4ed3a3e 100644
--- a/drivers/input/joystick/grip_mp.c
+++ b/drivers/input/joystick/grip_mp.c
@@ -320,10 +320,10 @@ static int multiport_io(struct gameport* gameport, int sendflags, int sendcode,
 
 static int dig_mode_start(struct gameport *gameport, u32 *packet)
 {
-	int i, seq_len = sizeof(init_seq)/sizeof(int);
+	int i;
 	int flags, tries = 0, bads = 0;
 
-	for (i = 0; i < seq_len; i++) {     /* Send magic sequence */
+	for (i = 0; i < ARRAY_SIZE(init_seq); i++) {     /* Send magic sequence */
 		if (init_seq[i])
 			gameport_trigger(gameport);
 		udelay(GRIP_INIT_DELAY);

                 reply	other threads:[~2007-06-06 20:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200706062210.11555.lists-receive@programmierforen.de \
    --to=lists-receive@programmierforen.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-joystick@atrey.karlin.mff.cuni.cz \
    /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).