Skip to contentSkip to conversation

snd: aica - fix annoying compiler warning

PATCH In review Adrian McMenamin 3 participants 7 messages Mar 15, 2009 – Apr 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd: aica - fix annoying compiler warning

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

sound/sh/aica.c +1 -1
index 7c920f3..822b119 100644
@@ -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;
#1 lore raw

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 14 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

sound/sh/aica.c +0 -0
index 7c920f3..822b119 100644

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 5 lines
sound/sh/aica.c +1 -1
@@ -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

#2 lore raw
Quoted 11 lines · Takashi Iwai

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 9 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

Quoted 14 lines

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 10 lines
sound/sh/aica.c +1 -1
index 7c920f3..822b119 100644
@@ -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.

#3 lore raw

At Mon, 16 Mar 2009 07:54:09 +0000,

Quoted 28 lines · Adrian McMenamin
Quoted 11 lines · Takashi Iwai

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 9 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

Quoted 14 lines

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 10 lines
sound/sh/aica.c +1 -1
index 7c920f3..822b119 100644
@@ -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.

Quoted 2 lines

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

---

sound/sh/aica.c +2 -2
index f551233..fad0c47 100644
@@ -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;
#4 lore raw
Quoted 30 lines · Takashi Iwai

At Mon, 16 Mar 2009 07:54:09 +0000,

Quoted 28 lines · Adrian McMenamin
Quoted 25 lines · Takashi Iwai

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 14 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

sound/sh/aica.c +0 -0
index 7c920f3..822b119 100644

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 5 lines
sound/sh/aica.c +1 -1
@@ -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.

Quoted 5 lines
Quoted 2 lines

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?

Quoted 22 lines

---

sound/sh/aica.c +2 -3
index f551233..fad0c47 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 31 lines · Paul Mundt
Quoted 30 lines · Takashi Iwai

At Mon, 16 Mar 2009 07:54:09 +0000,

Quoted 28 lines · Adrian McMenamin
Quoted 25 lines · Takashi Iwai

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 14 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

sound/sh/aica.c +0 -0
index 7c920f3..822b119 100644

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 5 lines
sound/sh/aica.c +1 -1
@@ -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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

#6 lore raw

At Thu, 02 Apr 2009 00:41:50 +0100,

Quoted 36 lines · Adrian McMenamin
Quoted 34 lines · Paul Mundt
Quoted 33 lines · Takashi Iwai

At Mon, 16 Mar 2009 07:54:09 +0000,

Quoted 30 lines · Adrian McMenamin
Quoted 11 lines · Takashi Iwai

At Sun, 15 Mar 2009 22:05:40 +0000,

Quoted 9 lines · Adrian McMenamin

Cast pointer to data member of struct firmware as a void to end an annoying compiler warning.

fix annoying compiler warning

---

Quoted 14 lines

sound/sh/aica.c static int load_aica_firmware(void) · line 570

Quoted 10 lines
sound/sh/aica.c +1 -1
index 7c920f3..822b119 100644
@@ -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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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