From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755485AbYBASHZ (ORCPT ); Fri, 1 Feb 2008 13:07:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752340AbYBASHN (ORCPT ); Fri, 1 Feb 2008 13:07:13 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59637 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977AbYBASHL (ORCPT ); Fri, 1 Feb 2008 13:07:11 -0500 Message-ID: <47A35FBB.5030003@zytor.com> Date: Fri, 01 Feb 2008 10:06:51 -0800 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Ingo Molnar CC: Harvey Harrison , Thomas Gleixner , LKML Subject: Re: [PATCH] x86: sparse errors from string_32.h References: <1201846516.23523.87.camel@brick> <20080201105624.GD27178@elte.hu> In-Reply-To: <20080201105624.GD27178@elte.hu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ingo Molnar wrote: > * Harvey Harrison 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