lkml.org 
[lkml]   [2008]   [Feb]   [1]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 01 Feb 2008 10:06:51 -0800
From"H. Peter Anvin" <>
SubjectRe: [PATCH] x86: sparse errors from string_32.h
Ingo Molnar wrote:
> * Harvey Harrison <harvey.harrison@gmail.com> wrote:
> 
>>  		case 1:
>> -			*(unsigned char *)s = pattern;
>> +			*(unsigned char *)s = pattern & 0xff;
> 
> i've applied your fix - but wouldnt it be cleaner to just cast the 
> pattern variable to unsigned char instead?
> 

Even better, since we're talking about fixed bytes, I suggest writing it as:

	*(u8 *)s = (u8)pattern;

Much more compact and the intent is a little bit more obvious.

	-hpa
--
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: 2008-02-01 18:11    [from the cache]
©2003-2008