All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: dac: remove redundant variable 'shift'
@ 2018-07-02 10:24 ` Colin King
  0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2018-07-02 10:24 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Sean Nyekjaer, linux-iio
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable shift is being assigned but is never used hence it is
redundant and can be removed.

Cleans up two clang warnings:
warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/dac/ti-dac5571.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
index dd21eebed6a8..e39d1e901353 100644
--- a/drivers/iio/dac/ti-dac5571.c
+++ b/drivers/iio/dac/ti-dac5571.c
@@ -97,9 +97,6 @@ static int dac5571_cmd_quad(struct dac5571_data *data, int channel, u16 val)
 
 static int dac5571_pwrdwn_single(struct dac5571_data *data, int channel, u8 pwrdwn)
 {
-	unsigned int shift;
-
-	shift = 12 - data->spec->resolution;
 	data->buf[1] = 0;
 	data->buf[0] = pwrdwn << DAC5571_SINGLE_PWRDWN_BITS;
 
@@ -111,9 +108,6 @@ static int dac5571_pwrdwn_single(struct dac5571_data *data, int channel, u8 pwrd
 
 static int dac5571_pwrdwn_quad(struct dac5571_data *data, int channel, u8 pwrdwn)
 {
-	unsigned int shift;
-
-	shift = 16 - data->spec->resolution;
 	data->buf[2] = 0;
 	data->buf[1] = pwrdwn << DAC5571_QUAD_PWRDWN_BITS;
 	data->buf[0] = (channel << DAC5571_CHANNEL_SELECT) |
-- 
2.17.1


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

* [PATCH] iio: dac: remove redundant variable 'shift'
@ 2018-07-02 10:24 ` Colin King
  0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2018-07-02 10:24 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Sean Nyekjaer, linux-iio
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable shift is being assigned but is never used hence it is
redundant and can be removed.

Cleans up two clang warnings:
warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/dac/ti-dac5571.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
index dd21eebed6a8..e39d1e901353 100644
--- a/drivers/iio/dac/ti-dac5571.c
+++ b/drivers/iio/dac/ti-dac5571.c
@@ -97,9 +97,6 @@ static int dac5571_cmd_quad(struct dac5571_data *data, int channel, u16 val)
 
 static int dac5571_pwrdwn_single(struct dac5571_data *data, int channel, u8 pwrdwn)
 {
-	unsigned int shift;
-
-	shift = 12 - data->spec->resolution;
 	data->buf[1] = 0;
 	data->buf[0] = pwrdwn << DAC5571_SINGLE_PWRDWN_BITS;
 
@@ -111,9 +108,6 @@ static int dac5571_pwrdwn_single(struct dac5571_data *data, int channel, u8 pwrd
 
 static int dac5571_pwrdwn_quad(struct dac5571_data *data, int channel, u8 pwrdwn)
 {
-	unsigned int shift;
-
-	shift = 16 - data->spec->resolution;
 	data->buf[2] = 0;
 	data->buf[1] = pwrdwn << DAC5571_QUAD_PWRDWN_BITS;
 	data->buf[0] = (channel << DAC5571_CHANNEL_SELECT) |
-- 
2.17.1


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

* Re: [PATCH] iio: dac: remove redundant variable 'shift'
  2018-07-02 10:24 ` Colin King
@ 2018-07-02 10:43   ` Sean Nyekjær
  -1 siblings, 0 replies; 7+ messages in thread
From: Sean Nyekjær @ 2018-07-02 10:43 UTC (permalink / raw)
  To: Colin King, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio
  Cc: kernel-janitors, linux-kernel



On 2018-07-02 12:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable shift is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up two clang warnings:
> warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>

Good catch :-)

BR
/Sean

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

* Re: [PATCH] iio: dac: remove redundant variable 'shift'
@ 2018-07-02 10:43   ` Sean Nyekjær
  0 siblings, 0 replies; 7+ messages in thread
From: Sean Nyekjær @ 2018-07-02 10:43 UTC (permalink / raw)
  To: Colin King, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio
  Cc: kernel-janitors, linux-kernel



On 2018-07-02 12:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable shift is being assigned but is never used hence it is
> redundant and can be removed.
> 
> Cleans up two clang warnings:
> warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>

Good catch :-)

BR
/Sean

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

* Re: [PATCH] iio: dac: remove redundant variable 'shift'
  2018-07-02 10:43   ` Sean Nyekjær
  (?)
@ 2018-07-07 16:45     ` Jonathan Cameron
  -1 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2018-07-07 16:45 UTC (permalink / raw)
  To: Sean Nyekjær
  Cc: Colin King, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors, linux-kernel

On Mon, 2 Jul 2018 12:43:20 +0200
Sean Nyekjær <sean.nyekjaer@prevas.dk> wrote:

> On 2018-07-02 12:24, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > Variable shift is being assigned but is never used hence it is
> > redundant and can be removed.
> > 
> > Cleans up two clang warnings:
> > warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>  
> Reviewed-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> 
> Good catch :-)
> 
> BR
> /Sean
Hi Colin,

As ever, thanks for the patch!

If you wouldn't mind putting the name of the driver in question in patches
like these that would be great.    There are enough drivers, that I doubt
anyone (other than me) looks at all patches for DACs.  They only look at
the particular parts they actually have on boards ;)

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan



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

* Re: [PATCH] iio: dac: remove redundant variable 'shift'
@ 2018-07-07 16:45     ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2018-07-07 16:45 UTC (permalink / raw)
  To: Sean Nyekjær
  Cc: Colin King, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors, linux-kernel

On Mon, 2 Jul 2018 12:43:20 +0200
Sean Nyekjær <sean.nyekjaer@prevas.dk> wrote:

> On 2018-07-02 12:24, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > Variable shift is being assigned but is never used hence it is
> > redundant and can be removed.
> > 
> > Cleans up two clang warnings:
> > warning: variable ‘shift’ set but not used [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>  
> Reviewed-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> 
> Good catch :-)
> 
> BR
> /Sean
Hi Colin,

As ever, thanks for the patch!

If you wouldn't mind putting the name of the driver in question in patches
like these that would be great.    There are enough drivers, that I doubt
anyone (other than me) looks at all patches for DACs.  They only look at
the particular parts they actually have on boards ;)

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan



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

* Re: [PATCH] iio: dac: remove redundant variable 'shift'
@ 2018-07-07 16:45     ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2018-07-07 16:45 UTC (permalink / raw)
  To: Sean Nyekjær
  Cc: Colin King, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors, linux-kernel

On Mon, 2 Jul 2018 12:43:20 +0200
Sean Nyekj=C3=A6r <sean.nyekjaer@prevas.dk> wrote:

> On 2018-07-02 12:24, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >=20
> > Variable shift is being assigned but is never used hence it is
> > redundant and can be removed.
> >=20
> > Cleans up two clang warnings:
> > warning: variable =E2=80=98shift=E2=80=99 set but not used [-Wunused-bu=
t-set-variable]
> >=20
> > Signed-off-by: Colin Ian King <colin.king@canonical.com> =20
> Reviewed-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
>=20
> Good catch :-)
>=20
> BR
> /Sean
Hi Colin,

As ever, thanks for the patch!

If you wouldn't mind putting the name of the driver in question in patches
like these that would be great.    There are enough drivers, that I doubt
anyone (other than me) looks at all patches for DACs.  They only look at
the particular parts they actually have on boards ;)

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan



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

end of thread, other threads:[~2018-07-07 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 10:24 [PATCH] iio: dac: remove redundant variable 'shift' Colin King
2018-07-02 10:24 ` Colin King
2018-07-02 10:43 ` Sean Nyekjær
2018-07-02 10:43   ` Sean Nyekjær
2018-07-07 16:45   ` Jonathan Cameron
2018-07-07 16:45     ` Jonathan Cameron
2018-07-07 16:45     ` Jonathan Cameron

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.