From: Sam Ravnborg <sam@ravnborg.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Sergei Shtylyov <sshtylyov@ru.mvista.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] hpt366: fix section mismatch warnings
Date: Fri, 22 Feb 2008 21:43:27 +0100 [thread overview]
Message-ID: <20080222204327.GH7154@uranus.ravnborg.org> (raw)
In-Reply-To: <20080222194651.GA7154@uranus.ravnborg.org>
> @@ -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
next prev parent reply other threads:[~2008-02-22 20:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 19:46 [PATCH] hpt366: fix section mismatch warnings Sam Ravnborg
2008-02-22 19:53 ` Sergei Shtylyov
2008-02-22 20:57 ` Bartlomiej Zolnierkiewicz
2008-02-22 20:43 ` Sam Ravnborg [this message]
2008-02-23 21:22 ` [Fixed PATCH] " Sam Ravnborg
2008-02-24 14:33 ` Bartlomiej Zolnierkiewicz
2008-02-24 17:53 ` Sam Ravnborg
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=20080222204327.GH7154@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=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).