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] [thread-next>] [day] [month] [year] [list]
Message-Id: <200905171900.49991.bzolnier@gmail.com>
Date:	Sun, 17 May 2009 19:00:49 +0200
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	Sergei Shtylyov <sshtylyov@...mvista.com>
Cc:	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/7] ide: pass number of ports to ide_host_{alloc,add}()

On Thursday 14 May 2009 20:59:51 Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
> 
> > Pass number of ports to ide_host_{alloc,add}() and then update
> > all users accordingly.
> 
> > There should be no functional changes caused by this patch.
> 
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> 
> Acked-by: Sergei Shtylyov <sshtylyov@...mvista.com>
> 
> > Index: b/drivers/ide/buddha.c
> > ===================================================================
> > --- a/drivers/ide/buddha.c
> > +++ b/drivers/ide/buddha.c
> > @@ -160,7 +160,7 @@ static int __init buddha_init(void)
> >  
> >  	while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
> >  		unsigned long board;
> > -		hw_regs_t hw[MAX_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
> > +		hw_regs_t hw[MAX_NUM_HWIFS], *hws[] = { NULL, NULL, NULL };
> 
>     I think it makes sense to just drop the NULL initializers here...
> 
> >  
> >  		if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
> >  			buddha_num_hwifs = BUDDHA_NUM_HWIFS;
> > @@ -224,7 +224,7 @@ fail_base2:
> >  			hws[i] = &hw[i];
> >  		}
> >  
> > -		ide_host_add(&buddha_port_info, hws, NULL);
> > +		ide_host_add(&buddha_port_info, hws, i, NULL);
> 
>     ... since ide_host_add() won't look beyond hws[i - 1] anyway.
> 
> >  	}
> >  
> >  	return 0;
> > Index: b/drivers/ide/cmd640.c
> > ===================================================================
> > --- a/drivers/ide/cmd640.c
> > +++ b/drivers/ide/cmd640.c
> > @@ -708,7 +708,7 @@ static int __init cmd640x_init(void)
> >  	int second_port_cmd640 = 0, rc;
> >  	const char *bus_type, *port2;
> >  	u8 b, cfr;
> > -	hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
> > +	hw_regs_t hw[2], *hws[] = { NULL, NULL };
> 
>     Same here...
> 
> > Index: b/drivers/ide/gayle.c
> > ===================================================================
> > --- a/drivers/ide/gayle.c
> > +++ b/drivers/ide/gayle.c
> > @@ -125,7 +125,7 @@ static int __init gayle_init(void)
> >      unsigned long base, ctrlport, irqport;
> >      ide_ack_intr_t *ack_intr;
> >      int a4000, i, rc;
> > -    hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
> > +    hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL };
> 
>     ... and here.

done in v2:

...
v2:
- drop no longer needed NULL initializers in buddha.c, cmd640.c and gayle.c
  (noticed by Sergei)
...

diff -u b/drivers/ide/buddha.c b/drivers/ide/buddha.c
--- b/drivers/ide/buddha.c
+++ b/drivers/ide/buddha.c
@@ -160,7 +160,7 @@
 
 	while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
 		unsigned long board;
-		hw_regs_t hw[MAX_NUM_HWIFS], *hws[] = { NULL, NULL, NULL };
+		hw_regs_t hw[MAX_NUM_HWIFS], *hws[MAX_NUM_HWIFS];
 
 		if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
 			buddha_num_hwifs = BUDDHA_NUM_HWIFS;
diff -u b/drivers/ide/cmd640.c b/drivers/ide/cmd640.c
--- b/drivers/ide/cmd640.c
+++ b/drivers/ide/cmd640.c
@@ -708,7 +708,7 @@
 	int second_port_cmd640 = 0, rc;
 	const char *bus_type, *port2;
 	u8 b, cfr;
-	hw_regs_t hw[2], *hws[] = { NULL, NULL };
+	hw_regs_t hw[2], *hws[2];
 
 	if (cmd640_vlb && probe_for_cmd640_vlb()) {
 		bus_type = "VLB";
diff -u b/drivers/ide/gayle.c b/drivers/ide/gayle.c
--- b/drivers/ide/gayle.c
+++ b/drivers/ide/gayle.c
@@ -125,7 +125,7 @@
     unsigned long base, ctrlport, irqport;
     ide_ack_intr_t *ack_intr;
     int a4000, i, rc;
-    hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL };
+    hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[GAYLE_NUM_HWIFS];
 
     if (!MACH_IS_AMIGA)
 	return -ENODEV;
--
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