login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
May
»
21
Re: [PATCH] i2o: fix notifiers when max_drivers is configured
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Andrew Morton
Subject:
Re: [PATCH] i2o: fix notifiers when max_drivers is configured
Date: Sunday, May 20, 2007 - 9:16 pm
On Sun, 20 May 2007 23:27:28 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
quoted text
> Maxinum number of I2O drivers which could be registered is > configurable by max_drivers module parameter. > > But the module parameter is ignored and default value (I2O_MAX_DRIVERS = 8) > is used in the loops to notify all registered drivers. > > Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> > > --- > drivers/message/i2o/driver.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > Index: 2.6-mm/drivers/message/i2o/driver.c > =================================================================== > --- 2.6-mm.orig/drivers/message/i2o/driver.c > +++ 2.6-mm/drivers/message/i2o/driver.c > @@ -20,6 +20,7 @@ > #include <linux/workqueue.h> > #include <linux/string.h> > #include <linux/slab.h> > +#include <linux/log2.h> > #include "core.h" > > #define OSM_NAME "i2o" > @@ -260,7 +261,7 @@ void i2o_driver_notify_controller_add_al > int i; > struct i2o_driver *drv; > > - for (i = 0; i < I2O_MAX_DRIVERS; i++) { > + for (i = 0; i < i2o_max_drivers; i++) { > drv = i2o_drivers[i]; > > if (drv) > @@ -280,7 +281,7 @@ void i2o_driver_notify_controller_remove > int i; > struct i2o_driver *drv; > > - for (i = 0; i < I2O_MAX_DRIVERS; i++) { > + for (i = 0; i < i2o_max_drivers; i++) { > drv = i2o_drivers[i]; > > if (drv) > @@ -299,7 +300,7 @@ void i2o_driver_notify_device_add_all(st > int i; > struct i2o_driver *drv; > > - for (i = 0; i < I2O_MAX_DRIVERS; i++) { > + for (i = 0; i < i2o_max_drivers; i++) { > drv = i2o_drivers[i]; > > if (drv) > @@ -318,7 +319,7 @@ void i2o_driver_notify_device_remove_all > int i; > struct i2o_driver *drv; > > - for (i = 0; i < I2O_MAX_DRIVERS; i++) { > + for (i = 0; i < i2o_max_drivers; i++) { > drv = i2o_drivers[i]; > > if (drv) > @@ -340,8 +341,7 @@ int __init i2o_driver_init(void) > spin_lock_init(&i2o_drivers_lock); > > if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) || > - ((i2o_max_drivers ^ (i2o_max_drivers - 1)) != > - (2 * i2o_max_drivers - 1))) { > + !is_power_of_2(i2o_max_drivers)) { > osm_warn("max_drivers set to %d, but must be >=2 and <= 64 and " > "a power of 2\n", i2o_max_drivers); > i2o_max_drivers = I2O_MAX_DRIVERS; > @@ -349,7 +349,7 @@ int __init i2o_driver_init(void) > osm_info("max drivers = %d\n", i2o_max_drivers); > > i2o_drivers = > - kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); > + kcalloc(i2o_max_drivers, sizeof(*i2o_drivers), GFP_KERNEL); > if (!i2o_drivers) > return -ENOMEM; >
Is there any particular reason why i2o_max_drivers must be a power of two? It seems a peculiar constraint. -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] i2o: fix notifiers when max_drivers is configured
, Akinobu Mita
, (Sun May 20, 7:27 am)
Re: [PATCH] i2o: fix notifiers when max_drivers is configured
, Andrew Morton
, (Sun May 20, 9:16 pm)
Re: [PATCH] i2o: fix notifiers when max_drivers is configured
, Akinobu Mita
, (Mon May 21, 9:58 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Uwe Kleine-König
Re: [PATCH v2] ARM: allow, but warn, when issuing ioremap() on RAM
Ingo Molnar
Re: [RFC/RFT PATCH] sched: automated per tty task groups
Ingo Molnar
Re: [GIT PULL] time.c - respin
Robin Holt
Re: [PATCH 02 of 12] Fix ia64 compilation failure because of common code include bug
git
:
Mike Miller
git message
Junio C Hamano
Re: [PATCH] Detached HEAD (experimental)
Stefan Richter
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Petr Baudis
Re: PPC SHA-1 Updates in "pu"
git-commits-head
:
Linux Kernel Mailing List
libata: disable ATAPI AN by default
Linux Kernel Mailing List
ARM: 5905/1: ARM: Global ASID allocation on SMP
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
Linux Kernel Mailing List
Documentation/timers/hpet_example.c: only build on X86
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Jeff Garzik
Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM
openbsd-misc
:
Stuart Henderson
Re: Kuro5hin: OpenBSD Founder Theo deRaadt Has Conflict of Interest With AMD
Christian Weisgerber
Re: CARP with a single public IP address
Darrin Chandler
Re: strange output on openbsd C code
Marco Peereboom
Re: OpenBSD culture?
KURS ENGLESKOG JEZIKA NA 10 CD-a
AUDIO-VIZUELNA METODA UCENJA ENGLESKOG JEZIKA na 10 CD-a
Colocation donated by:
Syndicate