driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
@ 2019-10-08  7:40 ` Dan Carpenter
  2019-10-08  7:41 ` [PATCH v2 1/6] staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback zhengbin
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Dan Carpenter @ 2019-10-08  7:40 UTC (permalink / raw)
  To: zhengbin; +Cc: devel, eric, gregkh, abbotti, wahrenst

Looks good.  Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables
@ 2019-10-08  7:41 zhengbin
  2019-10-08  7:40 ` Dan Carpenter
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

v1->v2: need to judge the value of status, If status != 0, just return

zhengbin (6):
  staging: bcm2835-audio: Need to judge the return value of
    vchi_msg_dequeue in audio_vchi_callback
  staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'
  staging: sm750fb: Remove set but not used variable 'actual_mx_clk'
  staging: comedi: Remove set but not used variable 'data'
  staging: comedi: Remove set but not used variable 'hi'
  staging: comedi: Remove set but not used variable 'aref'

 drivers/staging/comedi/drivers/dt2814.c                     | 3 ---
 drivers/staging/comedi/drivers/dt2815.c                     | 3 +--
 drivers/staging/comedi/drivers/dt3000.c                     | 3 +--
 drivers/staging/sm750fb/ddk750_chip.c                       | 3 +--
 drivers/staging/sm750fb/ddk750_mode.c                       | 3 +--
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 3 +++
 6 files changed, 7 insertions(+), 11 deletions(-)

--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 1/6] staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
  2019-10-08  7:40 ` Dan Carpenter
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08  7:41 ` [PATCH v2 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk' zhengbin
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

If vchi_msg_dequeue return -1, variable m is not assigined,
need to return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
index c6f9cf1..5f6a73a 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -103,6 +103,9 @@ static void audio_vchi_callback(void *param,

 	status = vchi_msg_dequeue(instance->vchi_handle,
 				  &m, sizeof(m), &msg_len, VCHI_FLAGS_NONE);
+	if (status)
+		return;
+
 	if (m.type == VC_AUDIO_MSG_TYPE_RESULT) {
 		instance->result = m.result.success;
 		complete(&instance->msg_avail_comp);
--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
  2019-10-08  7:40 ` Dan Carpenter
  2019-10-08  7:41 ` [PATCH v2 1/6] staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback zhengbin
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08  7:41 ` [PATCH v2 3/6] staging: sm750fb: Remove set but not used variable 'actual_mx_clk' zhengbin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_mode.c: In function ddk750_setModeTiming:
drivers/staging/sm750fb/ddk750_mode.c:212:15: warning: variable uiActualPixelClk set but not used [-Wunused-but-set-variable]

It is not used since commit 81dee67e215b ("staging:
sm750fb: add sm750 to staging")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/sm750fb/ddk750_mode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 9722692..e0230f4 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -209,12 +209,11 @@ static int programModeRegisters(struct mode_parameter *pModeParam,
 int ddk750_setModeTiming(struct mode_parameter *parm, enum clock_type clock)
 {
 	struct pll_value pll;
-	unsigned int uiActualPixelClk;

 	pll.input_freq = DEFAULT_INPUT_CLOCK;
 	pll.clock_type = clock;

-	uiActualPixelClk = sm750_calc_pll_value(parm->pixel_clock, &pll);
+	sm750_calc_pll_value(parm->pixel_clock, &pll);
 	if (sm750_get_chip_type() == SM750LE) {
 		/* set graphic mode via IO method */
 		outb_p(0x88, 0x3d4);
--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 3/6] staging: sm750fb: Remove set but not used variable 'actual_mx_clk'
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
                   ` (2 preceding siblings ...)
  2019-10-08  7:41 ` [PATCH v2 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk' zhengbin
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08  7:41 ` [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data' zhengbin
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_chip.c: In function set_chip_clock:
drivers/staging/sm750fb/ddk750_chip.c:59:15: warning: variable actual_mx_clk set but not used [-Wunused-but-set-variable]

It is not used since commit f0977109a577 ("staging:
sm750fb: lower case to fix camelcase checkpatch warning")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/sm750fb/ddk750_chip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index e5988813..02860d3 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -56,7 +56,6 @@ static unsigned int get_mxclk_freq(void)
 static void set_chip_clock(unsigned int frequency)
 {
 	struct pll_value pll;
-	unsigned int actual_mx_clk;

 	/* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
 	if (sm750_get_chip_type() == SM750LE)
@@ -76,7 +75,7 @@ static void set_chip_clock(unsigned int frequency)
 		 * Return value of sm750_calc_pll_value gives the actual
 		 * possible clock.
 		 */
-		actual_mx_clk = sm750_calc_pll_value(frequency, &pll);
+		sm750_calc_pll_value(frequency, &pll);

 		/* Master Clock Control: MXCLK_PLL */
 		poke32(MXCLK_PLL_CTRL, sm750_format_pll_reg(&pll));
--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data'
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
                   ` (3 preceding siblings ...)
  2019-10-08  7:41 ` [PATCH v2 3/6] staging: sm750fb: Remove set but not used variable 'actual_mx_clk' zhengbin
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08 12:55   ` Ian Abbott
  2019-10-08  7:41 ` [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi' zhengbin
  2019-10-08  7:41 ` [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref' zhengbin
  6 siblings, 1 reply; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/comedi/drivers/dt2814.c: In function dt2814_interrupt:
drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable data set but not used [-Wunused-but-set-variable]

It is not used since commit 7806012e97ed ("staging:
comedi: refactor dt2814 driver and use module_comedi_driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/comedi/drivers/dt2814.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
index d2c7157..4825168 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -190,7 +190,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
 	struct comedi_device *dev = d;
 	struct dt2814_private *devpriv = dev->private;
 	struct comedi_subdevice *s = dev->read_subdev;
-	int data;

 	if (!dev->attached) {
 		dev_err(dev->class_dev, "spurious interrupt\n");
@@ -200,8 +199,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
 	hi = inb(dev->iobase + DT2814_DATA);
 	lo = inb(dev->iobase + DT2814_DATA);

-	data = (hi << 4) | (lo >> 4);
-
 	if (!(--devpriv->ntrig)) {
 		int i;

--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi'
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
                   ` (4 preceding siblings ...)
  2019-10-08  7:41 ` [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data' zhengbin
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08 12:56   ` Ian Abbott
  2019-10-08  7:41 ` [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref' zhengbin
  6 siblings, 1 reply; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/comedi/drivers/dt2815.c: In function dt2815_ao_insn:
drivers/staging/comedi/drivers/dt2815.c:91:19: warning: variable hi set but not used [-Wunused-but-set-variable]

It is not used since commit d6a929b7608a ("Staging:
comedi: add dt2815 driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/comedi/drivers/dt2815.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c
index 83026ba..bcf85ec 100644
--- a/drivers/staging/comedi/drivers/dt2815.c
+++ b/drivers/staging/comedi/drivers/dt2815.c
@@ -88,12 +88,11 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
 	struct dt2815_private *devpriv = dev->private;
 	int i;
 	int chan = CR_CHAN(insn->chanspec);
-	unsigned int lo, hi;
+	unsigned int lo;
 	int ret;

 	for (i = 0; i < insn->n; i++) {
 		lo = ((data[i] & 0x0f) << 4) | (chan << 1) | 0x01;
-		hi = (data[i] & 0xff0) >> 4;

 		ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00);
 		if (ret)
--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref'
  2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
                   ` (5 preceding siblings ...)
  2019-10-08  7:41 ` [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi' zhengbin
@ 2019-10-08  7:41 ` zhengbin
  2019-10-08 12:59   ` Ian Abbott
  6 siblings, 1 reply; 13+ messages in thread
From: zhengbin @ 2019-10-08  7:41 UTC (permalink / raw)
  To: gregkh, eric, wahrenst, abbotti, hsweeten, dan.carpenter, devel
  Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/comedi/drivers/dt3000.c: In function dt3k_ai_insn_read:
drivers/staging/comedi/drivers/dt3000.c:511:27: warning: variable aref set but not used [-Wunused-but-set-variable]

It is not used since commit 2e310235ca8f ("staging:
comedi: dt3000: rename dt3k_ai_insn()")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/staging/comedi/drivers/dt3000.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
index caf4d4d..f7c365b 100644
--- a/drivers/staging/comedi/drivers/dt3000.c
+++ b/drivers/staging/comedi/drivers/dt3000.c
@@ -508,12 +508,11 @@ static int dt3k_ai_insn_read(struct comedi_device *dev,
 			     unsigned int *data)
 {
 	int i;
-	unsigned int chan, gain, aref;
+	unsigned int chan, gain;

 	chan = CR_CHAN(insn->chanspec);
 	gain = CR_RANGE(insn->chanspec);
 	/* XXX docs don't explain how to select aref */
-	aref = CR_AREF(insn->chanspec);

 	for (i = 0; i < insn->n; i++)
 		data[i] = dt3k_readsingle(dev, DPR_SUBSYS_AI, chan, gain);
--
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data'
  2019-10-08  7:41 ` [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data' zhengbin
@ 2019-10-08 12:55   ` Ian Abbott
  2019-10-08 15:12     ` Greg KH
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Abbott @ 2019-10-08 12:55 UTC (permalink / raw)
  To: zhengbin, gregkh, eric, wahrenst, hsweeten, dan.carpenter, devel

On 08/10/2019 08:41, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/comedi/drivers/dt2814.c: In function dt2814_interrupt:
> drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable data set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 7806012e97ed ("staging:
> comedi: refactor dt2814 driver and use module_comedi_driver")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>   drivers/staging/comedi/drivers/dt2814.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
> index d2c7157..4825168 100644
> --- a/drivers/staging/comedi/drivers/dt2814.c
> +++ b/drivers/staging/comedi/drivers/dt2814.c
> @@ -190,7 +190,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
>   	struct comedi_device *dev = d;
>   	struct dt2814_private *devpriv = dev->private;
>   	struct comedi_subdevice *s = dev->read_subdev;
> -	int data;
> 
>   	if (!dev->attached) {
>   		dev_err(dev->class_dev, "spurious interrupt\n");
> @@ -200,8 +199,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
>   	hi = inb(dev->iobase + DT2814_DATA);
>   	lo = inb(dev->iobase + DT2814_DATA);
> 
> -	data = (hi << 4) | (lo >> 4);
> -
>   	if (!(--devpriv->ntrig)) {
>   		int i;
> 
> --
> 2.7.4
> 

There is something fishy going on there.  The driver ought to be writing 
the data to a buffer.

Can I suggest omitting this patch from the series so I can investigate 
and supply a proper fix?

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi'
  2019-10-08  7:41 ` [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi' zhengbin
@ 2019-10-08 12:56   ` Ian Abbott
  2019-10-08 15:12     ` Greg KH
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Abbott @ 2019-10-08 12:56 UTC (permalink / raw)
  To: zhengbin, gregkh, eric, wahrenst, hsweeten, dan.carpenter, devel

On 08/10/2019 08:41, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/comedi/drivers/dt2815.c: In function dt2815_ao_insn:
> drivers/staging/comedi/drivers/dt2815.c:91:19: warning: variable hi set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit d6a929b7608a ("Staging:
> comedi: add dt2815 driver")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>   drivers/staging/comedi/drivers/dt2815.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c
> index 83026ba..bcf85ec 100644
> --- a/drivers/staging/comedi/drivers/dt2815.c
> +++ b/drivers/staging/comedi/drivers/dt2815.c
> @@ -88,12 +88,11 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
>   	struct dt2815_private *devpriv = dev->private;
>   	int i;
>   	int chan = CR_CHAN(insn->chanspec);
> -	unsigned int lo, hi;
> +	unsigned int lo;
>   	int ret;
> 
>   	for (i = 0; i < insn->n; i++) {
>   		lo = ((data[i] & 0x0f) << 4) | (chan << 1) | 0x01;
> -		hi = (data[i] & 0xff0) >> 4;
> 
>   		ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00);
>   		if (ret)
> --
> 2.7.4
> 

There is something fishy going on in this one too.  It should be writing 
the 'hi' value to the card registers.

Please could you omit this patch from the series so I can investigate?

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref'
  2019-10-08  7:41 ` [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref' zhengbin
@ 2019-10-08 12:59   ` Ian Abbott
  0 siblings, 0 replies; 13+ messages in thread
From: Ian Abbott @ 2019-10-08 12:59 UTC (permalink / raw)
  To: zhengbin, gregkh, eric, wahrenst, hsweeten, dan.carpenter, devel

On 08/10/2019 08:41, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/comedi/drivers/dt3000.c: In function dt3k_ai_insn_read:
> drivers/staging/comedi/drivers/dt3000.c:511:27: warning: variable aref set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 2e310235ca8f ("staging:
> comedi: dt3000: rename dt3k_ai_insn()")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>   drivers/staging/comedi/drivers/dt3000.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
> index caf4d4d..f7c365b 100644
> --- a/drivers/staging/comedi/drivers/dt3000.c
> +++ b/drivers/staging/comedi/drivers/dt3000.c
> @@ -508,12 +508,11 @@ static int dt3k_ai_insn_read(struct comedi_device *dev,
>   			     unsigned int *data)
>   {
>   	int i;
> -	unsigned int chan, gain, aref;
> +	unsigned int chan, gain;
> 
>   	chan = CR_CHAN(insn->chanspec);
>   	gain = CR_RANGE(insn->chanspec);
>   	/* XXX docs don't explain how to select aref */
> -	aref = CR_AREF(insn->chanspec);
> 
>   	for (i = 0; i < insn->n; i++)
>   		data[i] = dt3k_readsingle(dev, DPR_SUBSYS_AI, chan, gain);
> --
> 2.7.4
> 

That looks fine, thanks.

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:    )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data'
  2019-10-08 12:55   ` Ian Abbott
@ 2019-10-08 15:12     ` Greg KH
  0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2019-10-08 15:12 UTC (permalink / raw)
  To: Ian Abbott; +Cc: devel, zhengbin, eric, wahrenst, dan.carpenter

On Tue, Oct 08, 2019 at 01:55:01PM +0100, Ian Abbott wrote:
> On 08/10/2019 08:41, zhengbin wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/staging/comedi/drivers/dt2814.c: In function dt2814_interrupt:
> > drivers/staging/comedi/drivers/dt2814.c:193:6: warning: variable data set but not used [-Wunused-but-set-variable]
> > 
> > It is not used since commit 7806012e97ed ("staging:
> > comedi: refactor dt2814 driver and use module_comedi_driver")
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: zhengbin <zhengbin13@huawei.com>
> > ---
> >   drivers/staging/comedi/drivers/dt2814.c | 3 ---
> >   1 file changed, 3 deletions(-)
> > 
> > diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
> > index d2c7157..4825168 100644
> > --- a/drivers/staging/comedi/drivers/dt2814.c
> > +++ b/drivers/staging/comedi/drivers/dt2814.c
> > @@ -190,7 +190,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
> >   	struct comedi_device *dev = d;
> >   	struct dt2814_private *devpriv = dev->private;
> >   	struct comedi_subdevice *s = dev->read_subdev;
> > -	int data;
> > 
> >   	if (!dev->attached) {
> >   		dev_err(dev->class_dev, "spurious interrupt\n");
> > @@ -200,8 +199,6 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
> >   	hi = inb(dev->iobase + DT2814_DATA);
> >   	lo = inb(dev->iobase + DT2814_DATA);
> > 
> > -	data = (hi << 4) | (lo >> 4);
> > -
> >   	if (!(--devpriv->ntrig)) {
> >   		int i;
> > 
> > --
> > 2.7.4
> > 
> 
> There is something fishy going on there.  The driver ought to be writing the
> data to a buffer.
> 
> Can I suggest omitting this patch from the series so I can investigate and
> supply a proper fix?

Now dropped.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi'
  2019-10-08 12:56   ` Ian Abbott
@ 2019-10-08 15:12     ` Greg KH
  0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2019-10-08 15:12 UTC (permalink / raw)
  To: Ian Abbott; +Cc: devel, zhengbin, eric, wahrenst, dan.carpenter

On Tue, Oct 08, 2019 at 01:56:49PM +0100, Ian Abbott wrote:
> On 08/10/2019 08:41, zhengbin wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/staging/comedi/drivers/dt2815.c: In function dt2815_ao_insn:
> > drivers/staging/comedi/drivers/dt2815.c:91:19: warning: variable hi set but not used [-Wunused-but-set-variable]
> > 
> > It is not used since commit d6a929b7608a ("Staging:
> > comedi: add dt2815 driver")
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: zhengbin <zhengbin13@huawei.com>
> > ---
> >   drivers/staging/comedi/drivers/dt2815.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c
> > index 83026ba..bcf85ec 100644
> > --- a/drivers/staging/comedi/drivers/dt2815.c
> > +++ b/drivers/staging/comedi/drivers/dt2815.c
> > @@ -88,12 +88,11 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
> >   	struct dt2815_private *devpriv = dev->private;
> >   	int i;
> >   	int chan = CR_CHAN(insn->chanspec);
> > -	unsigned int lo, hi;
> > +	unsigned int lo;
> >   	int ret;
> > 
> >   	for (i = 0; i < insn->n; i++) {
> >   		lo = ((data[i] & 0x0f) << 4) | (chan << 1) | 0x01;
> > -		hi = (data[i] & 0xff0) >> 4;
> > 
> >   		ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00);
> >   		if (ret)
> > --
> > 2.7.4
> > 
> 
> There is something fishy going on in this one too.  It should be writing the
> 'hi' value to the card registers.
> 
> Please could you omit this patch from the series so I can investigate?

Now dropped, thanks.

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2019-10-08 15:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08  7:41 [PATCH v2 0/6] staging: Remove a bounch set of set but not used variables zhengbin
2019-10-08  7:40 ` Dan Carpenter
2019-10-08  7:41 ` [PATCH v2 1/6] staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback zhengbin
2019-10-08  7:41 ` [PATCH v2 2/6] staging: sm750fb: Remove set but not used variable 'uiActualPixelClk' zhengbin
2019-10-08  7:41 ` [PATCH v2 3/6] staging: sm750fb: Remove set but not used variable 'actual_mx_clk' zhengbin
2019-10-08  7:41 ` [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data' zhengbin
2019-10-08 12:55   ` Ian Abbott
2019-10-08 15:12     ` Greg KH
2019-10-08  7:41 ` [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi' zhengbin
2019-10-08 12:56   ` Ian Abbott
2019-10-08 15:12     ` Greg KH
2019-10-08  7:41 ` [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref' zhengbin
2019-10-08 12:59   ` Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).