lkml.org 
[lkml]   [2008]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-02-22 21:45    [W:0.044 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site