From patchwork Mon Mar 16 07:59:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 12328 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2G7xOe9010265 for ; Mon, 16 Mar 2009 07:59:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755685AbZCPH7Y (ORCPT ); Mon, 16 Mar 2009 03:59:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755968AbZCPH7Y (ORCPT ); Mon, 16 Mar 2009 03:59:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:56411 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755130AbZCPH7X (ORCPT ); Mon, 16 Mar 2009 03:59:23 -0400 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 122235017D; Mon, 16 Mar 2009 08:59:21 +0100 (CET) Date: Mon, 16 Mar 2009 08:59:20 +0100 Message-ID: From: Takashi Iwai To: Adrian McMenamin Cc: Alsa-devel , LKML , linux-sh Subject: Re: [PATCH] snd: aica - fix annoying compiler warning In-Reply-To: <1237190049.6513.3.camel@localhost.localdomain> References: <1237154740.6636.4.camel@localhost.localdomain> <1237190049.6513.3.camel@localhost.localdomain> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org At Mon, 16 Mar 2009 07:54:09 +0000, Adrian McMenamin wrote: > > On Mon, 2009-03-16 at 07:31 +0100, Takashi Iwai wrote: > > At Sun, 15 Mar 2009 22:05:40 +0000, > > Adrian McMenamin wrote: > > > > > > Cast pointer to data member of struct firmware as a void to end an > > > annoying compiler warning. > > > > > > fix annoying compiler warning > > > > > > Signed-off-by: Adrian McMenamin > > > --- > > > > > > diff --git a/sound/sh/aica.c b/sound/sh/aica.c > > > index 7c920f3..822b119 100644 > > > --- a/sound/sh/aica.c > > > +++ b/sound/sh/aica.c > > > @@ -567,7 +567,7 @@ static int load_aica_firmware(void) > > > return err; > > > /* write firware into memory */ > > > spu_disable(); > > > - spu_memload(0, fw_entry->data, fw_entry->size); > > > + spu_memload(0, (void *)fw_entry->data, fw_entry->size); > > > > IMO, it's better to fix spu_memload() to take const pointer instead of > > cast. > > > > If that's what you want I can do that but it adds to kernel bloat by > having two functions essentially do the same thing. I meant a fix like below... Takashi --- -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/sound/sh/aica.c b/sound/sh/aica.c index f551233..fad0c47 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c @@ -119,10 +119,10 @@ static void spu_memset(u32 toi, u32 what, int length) } /* spu_memload - write to SPU address space */ -static void spu_memload(u32 toi, void *from, int length) +static void spu_memload(u32 toi, const void *from, int length) { unsigned long flags; - u32 *froml = from; + const u32 *froml = from; u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi); int i; u32 val;