All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
  2015-01-28 21:49 [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used Rickard Strandqvist
@ 2015-01-28 21:48 ` Hartley Sweeten
  2015-01-28 22:33   ` Rickard Strandqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Hartley Sweeten @ 2015-01-28 21:48 UTC (permalink / raw)
  To: Rickard Strandqvist, Ian Abbott
  Cc: Greg Kroah-Hartman, Chase Southwood, Conrad Meyer, Fred Akers,
	devel, linux-kernel

On Wednesday, January 28, 2015 2:49 PM, Rickard Strandqvist wrote:
> Variable ar assigned a value that is never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c |   12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)

This file has been deleted.

Please base comedi patches on the current linux-next tree.

Thanks,
Hartley


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
@ 2015-01-28 21:49 Rickard Strandqvist
  2015-01-28 21:48 ` Hartley Sweeten
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-28 21:49 UTC (permalink / raw)
  To: Ian Abbott, H Hartley Sweeten
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, Chase Southwood,
	Conrad Meyer, Fred Akers, devel, linux-kernel

Variable ar assigned a value that is never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
index bfa9228..faa71a9 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
@@ -467,8 +467,6 @@ static int apci1500_di_write(struct comedi_device *dev,
 			     unsigned int *data)
 {
 	struct apci1500_private *devpriv = dev->private;
-	int i_Event1InterruptStatus = 0, i_Event2InterruptStatus =
-		0, i_RegValue;
 
 	switch (data[0]) {
 	case START:
@@ -499,11 +497,9 @@ static int apci1500_di_write(struct comedi_device *dev,
 					outb(0xF4,
 						devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
-					i_Event1InterruptStatus = 1;
 					outb(APCI1500_RW_PORT_A_SPECIFICATION,
 						devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
-					i_RegValue =
 						inb(devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
 
@@ -549,7 +545,6 @@ static int apci1500_di_write(struct comedi_device *dev,
 					outb(0xD0,
 						devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
-					i_Event2InterruptStatus = 1;
 				} else {
 					dev_warn(dev->class_dev,
 						"Event 2 not initialised\n");
@@ -592,7 +587,6 @@ static int apci1500_di_write(struct comedi_device *dev,
 					outb(0xF4,
 						devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
-					i_Event1InterruptStatus = 0;
 				} else {
 					dev_warn(dev->class_dev,
 						"Event 1 not initialised\n");
@@ -621,7 +615,6 @@ static int apci1500_di_write(struct comedi_device *dev,
 					outb(0xF4,
 						devpriv->iobase +
 						APCI1500_Z8536_CONTROL_REGISTER);
-					i_Event2InterruptStatus = 0;
 				} else {
 
 					dev_warn(dev->class_dev,
@@ -1896,7 +1889,6 @@ static int apci1500_do_bits(struct comedi_device *dev,
 			    unsigned int *data)
 {
 	struct apci1500_private *devpriv = dev->private;
-	unsigned int ui_Status;
 	int i_RegValue;
 	int i_Constant;
 
@@ -2004,8 +1996,8 @@ static int apci1500_do_bits(struct comedi_device *dev,
 
 	/* Enables the PCI interrupt */
 	outl(0x3000, devpriv->i_IobaseAmcc + 0x38);
-	ui_Status = inl(devpriv->i_IobaseAmcc + 0x10);
-	ui_Status = inl(devpriv->i_IobaseAmcc + 0x38);
+	inl(devpriv->i_IobaseAmcc + 0x10);
+	inl(devpriv->i_IobaseAmcc + 0x38);
 	outl(0x23000, devpriv->i_IobaseAmcc + 0x38);
 
 	return insn->n;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
  2015-01-28 21:48 ` Hartley Sweeten
@ 2015-01-28 22:33   ` Rickard Strandqvist
  0 siblings, 0 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-28 22:33 UTC (permalink / raw)
  To: Hartley Sweeten
  Cc: Ian Abbott, Greg Kroah-Hartman, Chase Southwood, Conrad Meyer,
	Fred Akers, devel, linux-kernel

2015-01-28 22:48 GMT+01:00 Hartley Sweeten <HartleyS@visionengravers.com>:
> On Wednesday, January 28, 2015 2:49 PM, Rickard Strandqvist wrote:
>> Variable ar assigned a value that is never used.
>> I have also removed all the code that thereby serves no purpose.
>>
>> This was found using a static code analysis program called cppcheck
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c |   12 ++----------
>>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> This file has been deleted.
>
> Please base comedi patches on the current linux-next tree.
>
> Thanks,
> Hartley
>


Hi

Sorry, but I have now added a test that do a git apply on linux-next
before I send a patch.


Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-29  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 21:49 [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used Rickard Strandqvist
2015-01-28 21:48 ` Hartley Sweeten
2015-01-28 22:33   ` Rickard Strandqvist

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.