Skip to contentSkip to conversation

mantis: fix unused variable compiler warning

PATCH In review Hans Verkuil 2 participants 2 messages Jun 11, 2015 – Jun 18, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mantis: fix unused variable compiler warning

mantis_i2c.c:222:15: warning: variable 'intmask' set but not used [-Wunused-but-set-variable]

  u32 intstat, intmask;
               ^
drivers/media/pci/mantis/mantis_i2c.c +1 -2
index a938234..9abe1c7 100644
@@ -219,7 +219,7 @@ static struct i2c_algorithm mantis_algo = {
 
 int mantis_i2c_init(struct mantis_pci *mantis)
 {
-	u32 intstat, intmask;
+	u32 intstat;
 	struct i2c_adapter *i2c_adapter = &mantis->adapter;
 	struct pci_dev *pdev		= mantis->pdev;
 
@@ -242,7 +242,6 @@ int mantis_i2c_init(struct mantis_pci *mantis)
 	dprintk(MANTIS_DEBUG, 1, "Initializing I2C ..");
 
 	intstat = mmread(MANTIS_INT_STAT);
-	intmask = mmread(MANTIS_INT_MASK);
 	mmwrite(intstat, MANTIS_INT_STAT);
 	dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
 	mantis_mask_ints(mantis, MANTIS_INT_I2CDONE);
#1 lore raw

Em Thu, 11 Jun 2015 08:05:25 +0200
Hans Verkuil <[email protected]> escreveu:

Quoted 20 lines

mantis_i2c.c:222:15: warning: variable 'intmask' set but not used [-Wunused-but-set-variable]

  u32 intstat, intmask;
               ^
drivers/media/pci/mantis/mantis_i2c.c +1 -1
index a938234..9abe1c7 100644
@@ -219,7 +219,7 @@ static struct i2c_algorithm mantis_algo = {
 
 int mantis_i2c_init(struct mantis_pci *mantis)
 {
-	u32 intstat, intmask;
+	u32 intstat;
 	struct i2c_adapter *i2c_adapter = &mantis->adapter;
 	struct pci_dev *pdev		= mantis->pdev;
 

drivers/media/pci/mantis/mantis_i2c.c int mantis_i2c_init(struct mantis_pci *mantis) · line 245

Quoted 4 lines
drivers/media/pci/mantis/mantis_i2c.c +0 -1
@@ -242,7 +242,6 @@ int mantis_i2c_init(struct mantis_pci *mantis)
 	dprintk(MANTIS_DEBUG, 1, "Initializing I2C ..");
 
 	intstat = mmread(MANTIS_INT_STAT);
-	intmask = mmread(MANTIS_INT_MASK);

Doing this sounds too risky for me without enough info from this device, as reading the mask could be needed in order to reset the IRQ.

I added earlier today a patch that keeps the mmread() there, just removing the temporary unused var.

Quoted 7 lines
drivers/media/pci/mantis/mantis_i2c.c +0 -1
 	mmwrite(intstat, MANTIS_INT_STAT);
 	dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
 	mantis_mask_ints(mantis, MANTIS_INT_I2CDONE);
--

To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html