snd: aica - fix annoying compiler warning
diff mbox

Message ID 1237154740.6636.4.camel@localhost.localdomain
State Rejected
Headers show

Commit Message

Adrian McMenamin March 15, 2009, 10:05 p.m. UTC
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 <adrian@mcmen.demon.co.uk>
---


--
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

Comments

Takashi Iwai March 16, 2009, 6:31 a.m. UTC | #1
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 <adrian@mcmen.demon.co.uk>
> ---
> 
> 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.


thanks,

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
Adrian McMenamin March 16, 2009, 7:54 a.m. UTC | #2
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 <adrian@mcmen.demon.co.uk>
> > ---
> > 
> > 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.

--
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

Patch
diff mbox

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);
 	spu_enable();
 	release_firmware(fw_entry);
 	return err;