From: "John W. Linville" <linville@tuxdriver.com>
To: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: proski@gnu.org, hermes@gibson.dropbear.id.au,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix unaligned exception in /drivers/net/wireless/orinoco.c
Date: Fri, 2 Feb 2007 15:20:39 -0500 [thread overview]
Message-ID: <20070202202039.GA9382@tuxdriver.com> (raw)
In-Reply-To: <600D5CB4DFD93545BF61FF01473D11AC0783715B@limkexm2.ad.analog.com>
On Thu, Jan 18, 2007 at 09:57:18AM -0000, Hennerich, Michael wrote:
>
> This short patch prevents an unaligned exception to occur. (GCC 4.1)
> tmp is defined as char pointer while it is later accessed as short.
>
> Best regards,
> Michael
>
> Index: linux-2.6.19.2/drivers/net/wireless/orinoco.c
> ===================================================================
> --- linux-2.6.x/drivers/net/wireless/orinoco.c (Revision 2649)
> +++ linux-2.6.x/drivers/net/wireless/orinoco.c (Arbeitskopie)
> @@ -2053,7 +2053,7 @@
> int err;
> struct comp_id nic_id, sta_id;
> unsigned int firmver;
> - char tmp[SYMBOL_MAX_VER_LEN+1];
> + char tmp[SYMBOL_MAX_VER_LEN+1] __attribute__ ((aligned(2)));
>
> /* Get the hardware version */
> err = HERMES_READ_RECORD(hw, USER_BAP, HERMES_RID_NICID, &nic_id);
This patch seems fine, such as it is. But, it seems like it might
also be appropriate to change hermes_read_ltv and/or hermes_read_words
to not take void * parameters? This patch would still be needed,
but it might be more obvious to future coders?
John
--
John W. Linville
linville@tuxdriver.com
next prev parent reply other threads:[~2007-02-02 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 9:57 [PATCH] fix unaligned exception in /drivers/net/wireless/orinoco.c Hennerich, Michael
2007-02-02 20:20 ` John W. Linville [this message]
2007-02-05 5:08 ` Pavel Roskin
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=20070202202039.GA9382@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=Michael.Hennerich@analog.com \
--cc=hermes@gibson.dropbear.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=proski@gnu.org \
/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