[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080222204327.GH7154@uranus.ravnborg.org>
Date: Fri, 22 Feb 2008 21:43:27 +0100
From: Sam Ravnborg <sam@...nborg.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
Sergei Shtylyov <sshtylyov@...mvista.com>,
LKML <linux-kernel@...r.kernel.org>, linux-ide@...r.kernel.org
Subject: Re: [PATCH] hpt366: fix section mismatch warnings
> @@ -1570,11 +1570,13 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
> if (rev < 3)
> info = &hpt36x;
> else {
> - static const struct hpt_info *hpt37x_info[] =
> - { &hpt370, &hpt370a, &hpt372, &hpt372n };
> -
> - info = hpt37x_info[min_t(u8, rev, 6) - 3];
> - idx++;
> + switch (min_t(u8, rev, 6) - 3) {
> + case 0: info = &hpt370; break;
> + case 1: info = &hpt370a; break;
> + case 2: info = &hpt372; break;
> + case 3: info = &hpt372n; break;
> + }
> + idx++;
> }
I kept the calculation as it was before but the '- 3'
is not needed. So it could be fixed and the case N:
should then be updated.
[Thanks to Sergei to not this]
Another note: The warnings were seen with a
make CONFIG_DEBUG_SECTION_MISMATCH=y build so they most likely
does not show up duing a typical build due to the inlining performed
by gcc.
Sam
--
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