* [PATCH] snd: aica - fix annoying compiler warning @ 2009-03-15 22:05 Adrian McMenamin 2009-03-16 6:31 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Adrian McMenamin @ 2009-03-15 22:05 UTC (permalink / raw) To: Alsa-devel, Takashi Iwai; +Cc: LKML, linux-sh 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); spu_enable(); release_firmware(fw_entry); return err; ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-03-15 22:05 [PATCH] snd: aica - fix annoying compiler warning Adrian McMenamin @ 2009-03-16 6:31 ` Takashi Iwai 2009-03-16 7:54 ` Adrian McMenamin 0 siblings, 1 reply; 7+ messages in thread From: Takashi Iwai @ 2009-03-16 6:31 UTC (permalink / raw) To: Adrian McMenamin; +Cc: Alsa-devel, LKML, linux-sh 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-03-16 6:31 ` Takashi Iwai @ 2009-03-16 7:54 ` Adrian McMenamin 2009-03-16 7:59 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Adrian McMenamin @ 2009-03-16 7:54 UTC (permalink / raw) To: Takashi Iwai; +Cc: Alsa-devel, LKML, linux-sh 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-03-16 7:54 ` Adrian McMenamin @ 2009-03-16 7:59 ` Takashi Iwai 2009-03-30 23:10 ` Paul Mundt 0 siblings, 1 reply; 7+ messages in thread From: Takashi Iwai @ 2009-03-16 7:59 UTC (permalink / raw) To: Adrian McMenamin; +Cc: Alsa-devel, LKML, linux-sh 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 <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. I meant a fix like below... Takashi --- 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; ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-03-16 7:59 ` Takashi Iwai @ 2009-03-30 23:10 ` Paul Mundt 2009-04-01 23:41 ` Adrian McMenamin 0 siblings, 1 reply; 7+ messages in thread From: Paul Mundt @ 2009-03-30 23:10 UTC (permalink / raw) To: Takashi Iwai; +Cc: Adrian McMenamin, Alsa-devel, LKML, linux-sh On Mon, Mar 16, 2009 at 08:59:20AM +0100, Takashi Iwai wrote: > 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 <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. > > I meant a fix like below... > Is anything happening with this, or should I just ignore it? > --- > 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; > -- > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-03-30 23:10 ` Paul Mundt @ 2009-04-01 23:41 ` Adrian McMenamin 2009-04-06 1:28 ` Takashi Iwai 0 siblings, 1 reply; 7+ messages in thread From: Adrian McMenamin @ 2009-04-01 23:41 UTC (permalink / raw) To: Paul Mundt; +Cc: Takashi Iwai, Alsa-devel, LKML, linux-sh On Tue, 2009-03-31 at 08:10 +0900, Paul Mundt wrote: > On Mon, Mar 16, 2009 at 08:59:20AM +0100, Takashi Iwai wrote: > > 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 <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. > > > > I meant a fix like below... > > > Is anything happening with this, or should I just ignore it? > I though Takashi's fix was fine/obvious but it doesn't appear to have been pushed upstream (yet?) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] snd: aica - fix annoying compiler warning 2009-04-01 23:41 ` Adrian McMenamin @ 2009-04-06 1:28 ` Takashi Iwai 0 siblings, 0 replies; 7+ messages in thread From: Takashi Iwai @ 2009-04-06 1:28 UTC (permalink / raw) To: Adrian McMenamin; +Cc: Paul Mundt, Alsa-devel, LKML, linux-sh At Thu, 02 Apr 2009 00:41:50 +0100, Adrian McMenamin wrote: > > On Tue, 2009-03-31 at 08:10 +0900, Paul Mundt wrote: > > On Mon, Mar 16, 2009 at 08:59:20AM +0100, Takashi Iwai wrote: > > > 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 <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. > > > > > > I meant a fix like below... > > > > > Is anything happening with this, or should I just ignore it? > > > > I though Takashi's fix was fine/obvious but it doesn't appear to have > been pushed upstream (yet?) Well, then it'd be appreciated if you repost your patch with my fix. thanks, Takashi ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-06 1:28 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-15 22:05 [PATCH] snd: aica - fix annoying compiler warning Adrian McMenamin 2009-03-16 6:31 ` Takashi Iwai 2009-03-16 7:54 ` Adrian McMenamin 2009-03-16 7:59 ` Takashi Iwai 2009-03-30 23:10 ` Paul Mundt 2009-04-01 23:41 ` Adrian McMenamin 2009-04-06 1:28 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox