lkml.org 
[lkml]   [2007]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] fix unaligned exception in /drivers/net/wireless/orinoco.c
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-02 21:39    [W:0.057 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site