* [PATCH] Staging: comedi: addi-data: remove unnecessary variable initializations in hwdrv_apci035.c
@ 2014-02-28 7:30 Chase Southwood
2014-02-28 16:26 ` Ian Abbott
0 siblings, 1 reply; 2+ messages in thread
From: Chase Southwood @ 2014-02-28 7:30 UTC (permalink / raw)
To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood
Nearly every variable in hwdrv_apci035.c is initialized to 0 when it is
declared, and then set to some other value before ever being used. As
such, we can remove all of these initializations. They are accomplishing
nothing.
Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
---
.../comedi/drivers/addi-data/hwdrv_apci035.c | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c
index 9041fdf..80cca95 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c
@@ -169,9 +169,9 @@ static int i_APCI035_ConfigTimerWatchdog(struct comedi_device *dev,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_Status = 0;
- unsigned int ui_Command = 0;
- unsigned int ui_Mode = 0;
+ unsigned int ui_Status;
+ unsigned int ui_Command;
+ unsigned int ui_Mode;
i_Temp = 0;
devpriv->tsk_Current = current;
@@ -318,8 +318,8 @@ static int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device *dev,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_Command = 0;
- int i_Count = 0;
+ unsigned int ui_Command;
+ int i_Count;
if (data[0] == 1) {
ui_Command =
@@ -433,7 +433,7 @@ static int i_APCI035_ReadTimerWatchdog(struct comedi_device *dev,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_Status = 0; /* Status register */
+ unsigned int ui_Status; /* Status register */
i_WatchdogNbr = insn->unused[0];
@@ -526,7 +526,7 @@ static int i_APCI035_ReadAnalogInput(struct comedi_device *dev,
unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_CommandRegister = 0;
+ unsigned int ui_CommandRegister;
/* Set the start */
ui_CommandRegister = 0x80000;
@@ -557,7 +557,7 @@ static int i_APCI035_ReadAnalogInput(struct comedi_device *dev,
static int i_APCI035_Reset(struct comedi_device *dev)
{
struct addi_private *devpriv = dev->private;
- int i_Count = 0;
+ int i_Count;
for (i_Count = 1; i_Count <= 4; i_Count++) {
i_WatchdogNbr = i_Count;
@@ -591,11 +591,11 @@ static void v_APCI035_Interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
- unsigned int ui_StatusRegister1 = 0;
- unsigned int ui_StatusRegister2 = 0;
- unsigned int ui_ReadCommand = 0;
- unsigned int ui_ChannelNumber = 0;
- unsigned int ui_DigitalTemperature = 0;
+ unsigned int ui_StatusRegister1;
+ unsigned int ui_StatusRegister2;
+ unsigned int ui_ReadCommand;
+ unsigned int ui_ChannelNumber;
+ unsigned int ui_DigitalTemperature;
if (i_Temp == 1) {
i_WatchdogNbr = i_Flag;
--
1.8.5.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Staging: comedi: addi-data: remove unnecessary variable initializations in hwdrv_apci035.c
2014-02-28 7:30 [PATCH] Staging: comedi: addi-data: remove unnecessary variable initializations in hwdrv_apci035.c Chase Southwood
@ 2014-02-28 16:26 ` Ian Abbott
0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2014-02-28 16:26 UTC (permalink / raw)
To: Chase Southwood, gregkh; +Cc: Ian Abbott, hsweeten, devel, linux-kernel
On 2014-02-28 07:30, Chase Southwood wrote:
> Nearly every variable in hwdrv_apci035.c is initialized to 0 when it is
> declared, and then set to some other value before ever being used. As
> such, we can remove all of these initializations. They are accomplishing
> nothing.
>
> Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
> ---
> .../comedi/drivers/addi-data/hwdrv_apci035.c | 26 +++++++++++-----------
> 1 file changed, 13 insertions(+), 13 deletions(-)
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-28 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28 7:30 [PATCH] Staging: comedi: addi-data: remove unnecessary variable initializations in hwdrv_apci035.c Chase Southwood
2014-02-28 16:26 ` Ian Abbott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®