Re: [PATCH] hpt366: fix section mismatch warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -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-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux