Skip to contentSkip to conversation

sound: oss: fix build warning

PATCH In review Sudip Mukherjee 2 participants 2 messages May 14, 2015 – May 18, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound: oss: fix build warning

while building with allyesconfig it was giving a build warning about unused variable. declare the variable only if the driver is built as a module.

---

build tested with allyesconfig and allmodconfig

 sound/oss/ad1848.c | 2 ++
 1 file changed, 2 insertions(+)
sound/oss/ad1848.c +2 -0
index ec1ee07..10c8de1 100644
@@ -2860,6 +2860,7 @@ static struct {
 	{NULL}
 };
 
+#ifdef MODULE
 static struct isapnp_device_id id_table[] = {
 	{	ISAPNP_VENDOR('C','M','I'), ISAPNP_DEVICE(0x0001),
 		ISAPNP_VENDOR('@','@','@'), ISAPNP_FUNCTION(0x0001), 0 },
@@ -2877,6 +2878,7 @@ static struct isapnp_device_id id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(isapnp, id_table);
+#endif
 
 static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev *dev)
 {
Signature · 1 line
1.8.1.2
#1 lore raw

At Thu, 14 May 2015 16:42:59 +0530,

Quoted 6 lines · Sudip Mukherjee

while building with allyesconfig it was giving a build warning about unused variable. declare the variable only if the driver is built as a module.

Ideally it'd be better to convert to use isapnp_device_id table directly, but this code is a bit tricky (YMH0021 isn't exposed as a probe id), so I applied your patch as is.

thanks,

Takashi

Quoted 30 lines

---

build tested with allyesconfig and allmodconfig

 sound/oss/ad1848.c | 2 ++
 1 file changed, 2 insertions(+)
sound/oss/ad1848.c +2 -0
index ec1ee07..10c8de1 100644
@@ -2860,6 +2860,7 @@ static struct {
 	{NULL}
 };
 
+#ifdef MODULE
 static struct isapnp_device_id id_table[] = {
 	{	ISAPNP_VENDOR('C','M','I'), ISAPNP_DEVICE(0x0001),
 		ISAPNP_VENDOR('@','@','@'), ISAPNP_FUNCTION(0x0001), 0 },
@@ -2877,6 +2878,7 @@ static struct isapnp_device_id id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(isapnp, id_table);
+#endif
 
 static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev *dev)
 {
Signature · 1 line
1.8.1.2