From: Aaron Cripps <acripps@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] Re: [PATCH ARRAY_SIZE 1/4] kernel 2.6 size macro clean ups in
Date: Tue, 05 Jun 2007 22:52:56 +0000 [thread overview]
Message-ID: <4665EC18.7010309@gmail.com> (raw)
In-Reply-To: <465C99C3.4030802@gmail.com>
this is a simple patch to remove the MAX_SPEEDS macro in favor of the more
generic ARRAY_SIZE(arr) macro defined in kernel.h
Signed-off-by: Aaron Cripps <cripps@cs.mun.ca>
diff --git a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c
index 9715ab5..44bf0c2 100644
--- a/drivers/net/irda/actisys-sir.c
+++ b/drivers/net/irda/actisys-sir.c
@@ -67,8 +67,6 @@ static int actisys_reset(struct sir_dev *);
/* Note : the 220L doesn't support 38400, but we will fix that below */
static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
-#define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0]))
-
static struct dongle_driver act220l = {
.owner = THIS_MODULE,
.driver_name = "Actisys ACT-220L",
@@ -176,7 +174,7 @@ static int actisys_change_speed(struct sir_dev *dev,
unsigned speed)
* Now, we can set the speed requested. Send RTS pulses until we
* reach the target speed
*/
- for (i = 0; i < MAX_SPEEDS; i++) {
+ for (i = 0; i < ARRAY_SIZE(baud_rates); i++) {
if (speed = baud_rates[i]) {
dev->speed = speed;
break;
@@ -191,7 +189,7 @@ static int actisys_change_speed(struct sir_dev *dev,
unsigned speed)
}
/* Check if life is sweet... */
- if (i >= MAX_SPEEDS) {
+ if (i >= ARRAY_SIZE(baud_rates)) {
actisys_reset(dev);
ret = -EINVAL; /* This should not happen */
}
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2007-06-05 22:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-29 21:11 [KJ] Re: [PATCH ARRAY_SIZE 1/4] kernel 2.6 size macro clean ups in Aaron Cripps
2007-05-29 21:37 ` [KJ] Re: [PATCH ARRAY_SIZE 1/4] kernel 2.6 size macro clean ups Jaco Kroon
2007-05-29 21:51 ` Aaron Cripps
2007-05-29 22:17 ` Jaco Kroon
2007-05-29 23:12 ` Randy Dunlap
2007-05-29 23:18 ` Jaco Kroon
2007-06-05 22:52 ` Aaron Cripps [this message]
2007-06-05 23:19 ` [KJ] Re: [PATCH ARRAY_SIZE 1/4] kernel 2.6 size macro clean ups in Aaron Cripps
2007-06-06 3:09 ` [KJ] Re: [PATCH ARRAY_SIZE 1/4] kernel 2.6 size macro clean ups Richard Knutsson
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=4665EC18.7010309@gmail.com \
--to=acripps@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.