From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] ide: pass number of ports to ide_host_{alloc,add}()
Date: Sun, 17 May 2009 19:00:49 +0200 [thread overview]
Message-ID: <200905171900.49991.bzolnier@gmail.com> (raw)
In-Reply-To: <4A0C6A27.7010703@ru.mvista.com>
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@gmail.com>
>
> Acked-by: Sergei Shtylyov <sshtylyov@ru.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;
next prev parent reply other threads:[~2009-05-17 16:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 20:51 [PATCH 0/7] ide: minor improvements/cleanups Bartlomiej Zolnierkiewicz
2009-05-13 20:51 ` [PATCH 1/7] ide: BUG() on unknown requests Bartlomiej Zolnierkiewicz
2009-05-13 20:51 ` [PATCH 2/7] ide: BUG() on unknown flags in ide_disk_special() Bartlomiej Zolnierkiewicz
2009-05-13 20:52 ` [PATCH 3/7] ide: merge ide_disk_special() into do_special() Bartlomiej Zolnierkiewicz
2009-05-13 20:55 ` Joe Perches
2009-05-14 12:23 ` Sergei Shtylyov
2009-05-17 17:00 ` Bartlomiej Zolnierkiewicz
2009-05-18 21:40 ` Sergei Shtylyov
2009-05-13 20:52 ` [PATCH 4/7] ide: replace special_t typedef by IDE_SFLAG_* flags Bartlomiej Zolnierkiewicz
2009-05-14 13:04 ` Sergei Shtylyov
2009-05-13 20:52 ` [PATCH 5/7] ide: remove chipset field from hw_regs_t Bartlomiej Zolnierkiewicz
2009-05-14 17:08 ` Sergei Shtylyov
2009-05-13 20:52 ` [PATCH 6/7] ide: pass number of ports to ide_host_{alloc,add}() Bartlomiej Zolnierkiewicz
2009-05-14 18:59 ` Sergei Shtylyov
2009-05-14 19:51 ` Bartlomiej Zolnierkiewicz
2009-05-14 20:19 ` Sergei Shtylyov
2009-05-17 17:00 ` Bartlomiej Zolnierkiewicz [this message]
2009-05-13 20:52 ` [PATCH 7/7] ide: remove hw_regs_t typedef Bartlomiej Zolnierkiewicz
2009-05-15 12:17 ` Sergei Shtylyov
2009-05-13 21:44 ` [PATCH 0/7] ide: minor improvements/cleanups Bartlomiej Zolnierkiewicz
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=200905171900.49991.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sshtylyov@ru.mvista.com \
/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).