public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Harvey Harrison <harvey.harrison@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: sparse errors from string_32.h
Date: Fri, 01 Feb 2008 10:06:51 -0800	[thread overview]
Message-ID: <47A35FBB.5030003@zytor.com> (raw)
In-Reply-To: <20080201105624.GD27178@elte.hu>

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

  parent reply	other threads:[~2008-02-01 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01  6:15 [PATCH] x86: sparse errors from string_32.h Harvey Harrison
2008-02-01 10:56 ` Ingo Molnar
2008-02-01 11:07   ` Harvey Harrison
2008-02-01 18:06   ` H. Peter Anvin [this message]
2008-02-02  0:40     ` Harvey Harrison

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=47A35FBB.5030003@zytor.com \
    --to=hpa@zytor.com \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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