lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070521165821.GA4077@APFDCB5C>
Date:	Tue, 22 May 2007 01:58:21 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Markus Lidel <Markus.Lidel@...dowconnect.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2o: fix notifiers when max_drivers is configured

On Sun, May 20, 2007 at 09:16:59PM -0700, Andrew Morton wrote:
> > @@ -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;
> 
> Is there any particular reason why i2o_max_drivers must be a power of two? 
> It seems a peculiar constraint.

I can't find the reason.

Subject: [patch -mm] i2o: eliminate a peculiar constraint on i2o_max_drivers

There is no reason i2o_max_drivers must be a power of two.
This patch eliminates such a constraint.

Cc: Markus Lidel <Markus.Lidel@...dowconnect.com>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>

---
 drivers/message/i2o/driver.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 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,7 +20,6 @@
 #include <linux/workqueue.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <linux/log2.h>
 #include "core.h"
 
 #define OSM_NAME	"i2o"
@@ -340,10 +339,9 @@ int __init i2o_driver_init(void)
 
 	spin_lock_init(&i2o_drivers_lock);
 
-	if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64) ||
-	    !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);
+	if ((i2o_max_drivers < 2) || (i2o_max_drivers > 64)) {
+		osm_warn("max_drivers set to %d, but must be >=2 and <= 64\n",
+			 i2o_max_drivers);
 		i2o_max_drivers = I2O_MAX_DRIVERS;
 	}
 	osm_info("max drivers = %d\n", i2o_max_drivers);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ