Re: [PATCH] hpt366: fix section mismatch warnings
Sam Ravnborg wrote: hpt366: fix section mismatch warnings Fix following warnings: WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370 WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372 WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n Replace a static array with a small switch resulting in more readable code. Be consistent in use of __devinitconst for const data to avoid section type conflicts. Mark the pci table __devinitconst. Signed-off-by: Sam Ravnborg [EMAIL PROTECTED] Acked-by: Sergei Shtylyov [EMAIL PROTECTED] MBR, Sergei - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
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-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] hpt366: fix section mismatch warnings
On Friday 22 February 2008, Sergei Shtylyov wrote: Sam Ravnborg wrote: hpt366: fix section mismatch warnings Fix following warnings: WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370 WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372 WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n Replace a static array with a small switch resulting in more readable code. Be consistent in use of __devinitconst for const data to avoid section type conflicts. Mark the pci table __devinitconst. Signed-off-by: Sam Ravnborg [EMAIL PROTECTED] Acked-by: Sergei Shtylyov [EMAIL PROTECTED] applied - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html