lkml.org 
[lkml]   [2011]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/7] I2C: eg20t, remove unused variable
Hi Jiri,

On Wed, 23 Mar 2011 09:49:58 +0100, Jiri Slaby wrote:
> drivers/i2c/busses/i2c-eg20t.c:684:2: warning: Value stored to 'msglen' is never read
> msglen = (pmsg->len) - (subaddrlen + 1);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Jean Delvare <khali@linux-fr.org>
> Cc: linux-i2c@vger.kernel.org
> ---
> drivers/i2c/busses/i2c-eg20t.c | 8 --------
> 1 files changed, 0 insertions(+), 8 deletions(-)

This driver is under Ben Dooks's jurisdiction, not mine. You should get
this patch reviewed by him and Tomoya MORINAGA (both Cc'd.) It may be
that your simple fix is correct, but it may also be that the unused
variables should be used somewhere in the code for correctness. I can't
tell.

>
> diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
> index 878a120..ea73252 100644
> --- a/drivers/i2c/busses/i2c-eg20t.c
> +++ b/drivers/i2c/busses/i2c-eg20t.c
> @@ -651,8 +651,6 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
> struct i2c_msg *pmsg;
> u32 i = 0;
> u32 status;
> - u32 msglen;
> - u32 subaddrlen;
> s32 ret;
>
> struct i2c_algo_pch_data *adap = i2c_adap->algo_data;
> @@ -676,12 +674,6 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
> status = pmsg->flags;
> pch_dbg(adap,
> "After invoking I2C_MODE_SEL :flag= 0x%x\n", status);
> - /* calculate sub address length and message length */
> - /* these are applicable only for buffer mode */
> - subaddrlen = pmsg->buf[0];
> - /* calculate actual message length excluding
> - * the sub address fields */
> - msglen = (pmsg->len) - (subaddrlen + 1);
> if (status & (I2C_M_RD)) {
> pch_dbg(adap, "invoking pch_i2c_readbytes\n");
> ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num),


--
Jean Delvare


\
 
 \ /
  Last update: 2011-03-23 11:13    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site