2011-03-23 08:50:08

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 1/7] tty: VT, remove unused variable

drivers/tty/vt/vt_ioctl.c:1525:2: warning: Value stored to 'kbd' is never read
kbd = kbd_table + console;
^ ~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/vt/vt_ioctl.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index 937d172..8c7208a 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -1499,7 +1499,6 @@ long vt_compat_ioctl(struct tty_struct *tty,
{
struct vc_data *vc = tty->driver_data;
struct console_font_op op; /* used in multiple places here */
- struct kbd_struct *kbd;
unsigned int console;
void __user *up = (void __user *)arg;
int perm;
@@ -1522,7 +1521,6 @@ long vt_compat_ioctl(struct tty_struct *tty,
if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
perm = 1;

- kbd = kbd_table + console;
switch (cmd) {
/*
* these need special handlers for incompatible data structures
--
1.7.4.1


2011-03-23 08:50:11

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 3/7] Char: cyclades, fix unused variable

drivers/tty/cyclades.c:1454:2: warning: Value stored to 'channel' is never read
channel = info->line - card->first_line;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix it by moving it to the appropriate debug section where it is used.

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/cyclades.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index c99728f..e6f20d2 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -1445,13 +1445,11 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
{
struct cyclades_card *card;
unsigned long flags;
- int channel;

if (!(info->port.flags & ASYNC_INITIALIZED))
return;

card = info->card;
- channel = info->line - card->first_line;
if (!cy_is_Z(card)) {
spin_lock_irqsave(&card->card_lock, flags);

@@ -1476,6 +1474,7 @@ static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty)
spin_unlock_irqrestore(&card->card_lock, flags);
} else {
#ifdef CY_DEBUG_OPEN
+ int channel = info->line - card->first_line;
printk(KERN_DEBUG "cyc shutdown Z card %d, channel %d, "
"base_addr %p\n", card, channel, card->base_addr);
#endif
--
1.7.4.1

2011-03-23 08:50:10

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 4/7] TTY: VT, remove unused variables

drivers/tty/vt/vt.c:892:2: warning: Value stored to 'old_screen_size' is never read
old_screen_size = vc->vc_screenbuf_size;
^ ~~~~~~~~~~~~~~~~~~~~~
drivers/tty/vt/vt.c:890:2: warning: Value stored to 'old_cols' is never read
old_cols = vc->vc_cols;
^ ~~~~~~~~~~~

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/vt/vt.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index c83cdfb..10e9854 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -858,7 +858,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
{
unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
unsigned long end;
- unsigned int old_cols, old_rows, old_row_size, old_screen_size;
+ unsigned int old_rows, old_row_size;
unsigned int new_cols, new_rows, new_row_size, new_screen_size;
unsigned int user;
unsigned short *newscreen;
@@ -887,9 +887,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
return -ENOMEM;

old_rows = vc->vc_rows;
- old_cols = vc->vc_cols;
old_row_size = vc->vc_size_row;
- old_screen_size = vc->vc_screenbuf_size;

err = resize_screen(vc, new_cols, new_rows, user);
if (err) {
--
1.7.4.1

2011-03-23 08:50:48

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 6/7] Char: moxa, remove unused variables

drivers/tty/moxa.c:1287:2: warning: Value stored to 'port' is never read
port = tty->index;
^ ~~~~~~~~~~
drivers/tty/moxa.c:1763:2: warning: Value stored to 'cflag' is never read
cflag = termio->c_cflag; /* termio->c_cflag */
^ ~~~~~~~~~~~~~~~

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/moxa.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 35b0c38..ffdaab3 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -1281,10 +1281,8 @@ static int moxa_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct moxa_port *ch;
- int port;
int dtr, rts;

- port = tty->index;
mutex_lock(&moxa_openlock);
ch = tty->driver_data;
if (!ch) {
@@ -1756,11 +1754,9 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio,
speed_t baud)
{
void __iomem *ofsAddr;
- tcflag_t cflag;
tcflag_t mode = 0;

ofsAddr = port->tableAddr;
- cflag = termio->c_cflag; /* termio->c_cflag */

mode = termio->c_cflag & CSIZE;
if (mode == CS5)
--
1.7.4.1

2011-03-23 08:50:47

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 7/7] TTY: rocket, remove unused variables

drivers/tty/rocket.c:1393:2: warning: Value stored to 'cp' is never read
cp = &info->channel;
^ ~~~~~~~~~~~~~~
drivers/tty/rocket.c:1412:2: warning: Value stored to 'cp' is never read
cp = &info->channel;
^ ~~~~~~~~~~~~~~
drivers/tty/rocket.c:1730:2: warning: Value stored to 'cp' is never read
cp = &info->channel;
^ ~~~~~~~~~~~~~~
drivers/tty/rocket.c:1825:3: warning: Value stored to 'str' is never read
str = "8";
^ ~~~
[many 'str' warnings stripped]
drivers/tty/rocket.c:2037:3: warning: Value stored to 'board_type' is never read
board_type = "RocketModem";
^ ~~~~~~~~~~~~~
[some 'board_type' warnings stripped]

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/tty/rocket.c | 47 -----------------------------------------------
1 files changed, 0 insertions(+), 47 deletions(-)

diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index 3780da8..c6c68b0 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -1380,7 +1380,6 @@ static void rp_send_xchar(struct tty_struct *tty, char ch)
static void rp_throttle(struct tty_struct *tty)
{
struct r_port *info = tty->driver_data;
- CHANNEL_t *cp;

#ifdef ROCKET_DEBUG_THROTTLE
printk(KERN_INFO "throttle %s: %d....\n", tty->name,
@@ -1390,7 +1389,6 @@ static void rp_throttle(struct tty_struct *tty)
if (rocket_paranoia_check(info, "rp_throttle"))
return;

- cp = &info->channel;
if (I_IXOFF(tty))
rp_send_xchar(tty, STOP_CHAR(tty));

@@ -1400,7 +1398,6 @@ static void rp_throttle(struct tty_struct *tty)
static void rp_unthrottle(struct tty_struct *tty)
{
struct r_port *info = tty->driver_data;
- CHANNEL_t *cp;
#ifdef ROCKET_DEBUG_THROTTLE
printk(KERN_INFO "unthrottle %s: %d....\n", tty->name,
tty->ldisc.chars_in_buffer(tty));
@@ -1409,7 +1406,6 @@ static void rp_unthrottle(struct tty_struct *tty)
if (rocket_paranoia_check(info, "rp_throttle"))
return;

- cp = &info->channel;
if (I_IXOFF(tty))
rp_send_xchar(tty, START_CHAR(tty));

@@ -1722,13 +1718,10 @@ static int rp_write_room(struct tty_struct *tty)
static int rp_chars_in_buffer(struct tty_struct *tty)
{
struct r_port *info = tty->driver_data;
- CHANNEL_t *cp;

if (rocket_paranoia_check(info, "rp_chars_in_buffer"))
return 0;

- cp = &info->channel;
-
#ifdef ROCKET_DEBUG_WRITE
printk(KERN_INFO "rp_chars_in_buffer returns %d...\n", info->xmit_cnt);
#endif
@@ -1779,7 +1772,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
{
int num_aiops, aiop, max_num_aiops, num_chan, chan;
unsigned int aiopio[MAX_AIOPS_PER_BOARD];
- char *str, *board_type;
CONTROLLER_t *ctlp;

int fast_clock = 0;
@@ -1800,7 +1792,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
/* Depending on the model, set up some config variables */
switch (dev->device) {
case PCI_DEVICE_ID_RP4QUAD:
- str = "Quadcable";
max_num_aiops = 1;
ports_per_aiop = 4;
rocketModel[i].model = MODEL_RP4QUAD;
@@ -1808,42 +1799,36 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 4;
break;
case PCI_DEVICE_ID_RP8OCTA:
- str = "Octacable";
max_num_aiops = 1;
rocketModel[i].model = MODEL_RP8OCTA;
strcpy(rocketModel[i].modelString, "RocketPort 8 port w/octa cable");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_URP8OCTA:
- str = "Octacable";
max_num_aiops = 1;
rocketModel[i].model = MODEL_UPCI_RP8OCTA;
strcpy(rocketModel[i].modelString, "RocketPort UPCI 8 port w/octa cable");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_RP8INTF:
- str = "8";
max_num_aiops = 1;
rocketModel[i].model = MODEL_RP8INTF;
strcpy(rocketModel[i].modelString, "RocketPort 8 port w/external I/F");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_URP8INTF:
- str = "8";
max_num_aiops = 1;
rocketModel[i].model = MODEL_UPCI_RP8INTF;
strcpy(rocketModel[i].modelString, "RocketPort UPCI 8 port w/external I/F");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_RP8J:
- str = "8J";
max_num_aiops = 1;
rocketModel[i].model = MODEL_RP8J;
strcpy(rocketModel[i].modelString, "RocketPort 8 port w/RJ11 connectors");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_RP4J:
- str = "4J";
max_num_aiops = 1;
ports_per_aiop = 4;
rocketModel[i].model = MODEL_RP4J;
@@ -1851,56 +1836,48 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 4;
break;
case PCI_DEVICE_ID_RP8SNI:
- str = "8 (DB78 Custom)";
max_num_aiops = 1;
rocketModel[i].model = MODEL_RP8SNI;
strcpy(rocketModel[i].modelString, "RocketPort 8 port w/ custom DB78");
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_RP16SNI:
- str = "16 (DB78 Custom)";
max_num_aiops = 2;
rocketModel[i].model = MODEL_RP16SNI;
strcpy(rocketModel[i].modelString, "RocketPort 16 port w/ custom DB78");
rocketModel[i].numPorts = 16;
break;
case PCI_DEVICE_ID_RP16INTF:
- str = "16";
max_num_aiops = 2;
rocketModel[i].model = MODEL_RP16INTF;
strcpy(rocketModel[i].modelString, "RocketPort 16 port w/external I/F");
rocketModel[i].numPorts = 16;
break;
case PCI_DEVICE_ID_URP16INTF:
- str = "16";
max_num_aiops = 2;
rocketModel[i].model = MODEL_UPCI_RP16INTF;
strcpy(rocketModel[i].modelString, "RocketPort UPCI 16 port w/external I/F");
rocketModel[i].numPorts = 16;
break;
case PCI_DEVICE_ID_CRP16INTF:
- str = "16";
max_num_aiops = 2;
rocketModel[i].model = MODEL_CPCI_RP16INTF;
strcpy(rocketModel[i].modelString, "RocketPort Compact PCI 16 port w/external I/F");
rocketModel[i].numPorts = 16;
break;
case PCI_DEVICE_ID_RP32INTF:
- str = "32";
max_num_aiops = 4;
rocketModel[i].model = MODEL_RP32INTF;
strcpy(rocketModel[i].modelString, "RocketPort 32 port w/external I/F");
rocketModel[i].numPorts = 32;
break;
case PCI_DEVICE_ID_URP32INTF:
- str = "32";
max_num_aiops = 4;
rocketModel[i].model = MODEL_UPCI_RP32INTF;
strcpy(rocketModel[i].modelString, "RocketPort UPCI 32 port w/external I/F");
rocketModel[i].numPorts = 32;
break;
case PCI_DEVICE_ID_RPP4:
- str = "Plus Quadcable";
max_num_aiops = 1;
ports_per_aiop = 4;
altChanRingIndicator++;
@@ -1910,7 +1887,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 4;
break;
case PCI_DEVICE_ID_RPP8:
- str = "Plus Octacable";
max_num_aiops = 2;
ports_per_aiop = 4;
altChanRingIndicator++;
@@ -1920,7 +1896,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 8;
break;
case PCI_DEVICE_ID_RP2_232:
- str = "Plus 2 (RS-232)";
max_num_aiops = 1;
ports_per_aiop = 2;
altChanRingIndicator++;
@@ -1930,7 +1905,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 2;
break;
case PCI_DEVICE_ID_RP2_422:
- str = "Plus 2 (RS-422)";
max_num_aiops = 1;
ports_per_aiop = 2;
altChanRingIndicator++;
@@ -1943,7 +1917,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)

max_num_aiops = 1;
ports_per_aiop = 6;
- str = "6-port";

/* If revision is 1, the rocketmodem flash must be loaded.
* If it is 2 it is a "socketed" version. */
@@ -1961,7 +1934,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
case PCI_DEVICE_ID_RP4M:
max_num_aiops = 1;
ports_per_aiop = 4;
- str = "4-port";
if (dev->revision == 1) {
rcktpt_type[i] = ROCKET_TYPE_MODEMII;
rocketModel[i].loadrm2 = 1;
@@ -1974,7 +1946,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rocketModel[i].numPorts = 4;
break;
default:
- str = "(unknown/unsupported)";
max_num_aiops = 0;
break;
}
@@ -2000,14 +1971,12 @@ static __init int register_PCI(int i, struct pci_dev *dev)
if (!
(sInW(ConfigIO + _PCI_9030_GPIO_CTRL) &
PCI_GPIO_CTRL_8PORT)) {
- str = "Quadcable";
ports_per_aiop = 4;
rocketModel[i].numPorts = 4;
}
}
break;
case PCI_DEVICE_ID_UPCI_RM3_8PORT:
- str = "8 ports";
max_num_aiops = 1;
rocketModel[i].model = MODEL_UPCI_RM3_8PORT;
strcpy(rocketModel[i].modelString, "RocketModem III 8 port");
@@ -2018,7 +1987,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
rcktpt_type[i] = ROCKET_TYPE_MODEMIII;
break;
case PCI_DEVICE_ID_UPCI_RM3_4PORT:
- str = "4 ports";
max_num_aiops = 1;
rocketModel[i].model = MODEL_UPCI_RM3_4PORT;
strcpy(rocketModel[i].modelString, "RocketModem III 4 port");
@@ -2032,21 +2000,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
break;
}

- switch (rcktpt_type[i]) {
- case ROCKET_TYPE_MODEM:
- board_type = "RocketModem";
- break;
- case ROCKET_TYPE_MODEMII:
- board_type = "RocketModem II";
- break;
- case ROCKET_TYPE_MODEMIII:
- board_type = "RocketModem III";
- break;
- default:
- board_type = "RocketPort";
- break;
- }
-
if (fast_clock) {
sClockPrescale = 0x12; /* mod 2 (divide by 3) */
rp_baud_base[i] = 921600;
--
1.7.4.1

2011-03-23 08:51:21

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 2/7] TTY: serial_core, remove unused variable

drivers/tty/serial/serial_core.c:1980:2: warning: Value stored to 'tty' is never read
tty = port->tty;
^ ~~~~~~~~~

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
---
drivers/tty/serial/serial_core.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 733fe8e..d6e7240 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1972,13 +1972,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
struct tty_port *port = &state->port;
struct device *tty_dev;
struct uart_match match = {uport, drv};
- struct tty_struct *tty;

mutex_lock(&port->mutex);

- /* Must be inside the mutex lock until we convert to tty_port */
- tty = port->tty;
-
tty_dev = device_find_child(uport->dev, &match, serial_match_port);
if (device_may_wakeup(tty_dev)) {
if (!enable_irq_wake(uport->irq))
--
1.7.4.1

2011-03-23 08:51:19

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 5/7] I2C: eg20t, remove unused variable

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 <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: [email protected]
---
drivers/i2c/busses/i2c-eg20t.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)

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),
--
1.7.4.1

2011-03-23 09:15:54

by Govindraj

[permalink] [raw]
Subject: Re: [PATCH 2/7] TTY: serial_core, remove unused variable

On Wed, Mar 23, 2011 at 2:19 PM, Jiri Slaby <[email protected]> wrote:
> drivers/tty/serial/serial_core.c:1980:2: warning: Value stored to 'tty' is never read
> ? ? ? ?tty = port->tty;
> ? ? ? ?^ ? ? ~~~~~~~~~
>
> Signed-off-by: Jiri Slaby <[email protected]>


Acked-by: Govindraj.R <[email protected]>


> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> ---
> ?drivers/tty/serial/serial_core.c | ? ?4 ----
> ?1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 733fe8e..d6e7240 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1972,13 +1972,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
> ? ? ? ?struct tty_port *port = &state->port;
> ? ? ? ?struct device *tty_dev;
> ? ? ? ?struct uart_match match = {uport, drv};
> - ? ? ? struct tty_struct *tty;
>
> ? ? ? ?mutex_lock(&port->mutex);
>
> - ? ? ? /* Must be inside the mutex lock until we convert to tty_port */
> - ? ? ? tty = port->tty;
> -
> ? ? ? ?tty_dev = device_find_child(uport->dev, &match, serial_match_port);
> ? ? ? ?if (device_may_wakeup(tty_dev)) {
> ? ? ? ? ? ? ? ?if (!enable_irq_wake(uport->irq))
> --
> 1.7.4.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

2011-03-23 10:10:14

by Jean Delvare

[permalink] [raw]
Subject: Re: [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 <[email protected]>
> Cc: Jean Delvare <[email protected]>
> Cc: [email protected]
> ---
> 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

2011-03-23 10:50:36

by Tomoya MORINAGA

[permalink] [raw]
Subject: RE: [PATCH 5/7] I2C: eg20t, remove unused variable

Hi Jiri,

It looks OK.

Signed-off-by: Tomoya MORINAGA <[email protected]>

Thanks,
-----------------------------------------
Tomoya MORINAGA
OKI SEMICONDUCTOR CO., LTD.

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Jiri Slaby
> Sent: Wednesday, March 23, 2011 5:50 PM
> To: [email protected]
> Cc: [email protected]; Jiri Slaby; Jean Delvare;
> [email protected]
> Subject: [PATCH 5/7] I2C: eg20t, remove unused variable
>
> 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 <[email protected]>
> Cc: Jean Delvare <[email protected]>
> Cc: [email protected]
> ---
> drivers/i2c/busses/i2c-eg20t.c | 8 --------
> 1 files changed, 0 insertions(+), 8 deletions(-)
>
> 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),
> --
> 1.7.4.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2011-04-19 15:06:17

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 5/7] I2C: eg20t, remove unused variable

On 03/23/2011 11:50 AM, Tomoya MORINAGA wrote:
> Hi Jiri,
>
> It looks OK.
>
> Signed-off-by: Tomoya MORINAGA <[email protected]>

Hi, will somebody take it or should I resubmit?

> Thanks,
> -----------------------------------------
> Tomoya MORINAGA
> OKI SEMICONDUCTOR CO., LTD.
>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Jiri Slaby
>> Sent: Wednesday, March 23, 2011 5:50 PM
>> To: [email protected]
>> Cc: [email protected]; Jiri Slaby; Jean Delvare;
>> [email protected]
>> Subject: [PATCH 5/7] I2C: eg20t, remove unused variable
>>
>> 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 <[email protected]>
>> Cc: Jean Delvare <[email protected]>
>> Cc: [email protected]
>> ---
>> drivers/i2c/busses/i2c-eg20t.c | 8 --------
>> 1 files changed, 0 insertions(+), 8 deletions(-)
>>
>> 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),
>> --
>> 1.7.4.1
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>


--
js

2011-04-20 00:04:31

by Tomoya MORINAGA

[permalink] [raw]
Subject: RE: [PATCH 5/7] I2C: eg20t, remove unused variable

Hi Jiri

Until now, this driver have been reviewed / accepted by Ben Dooks [[email protected]].
Thus, I think he will review / accept with sooner or later.

Thanks,
-----------------------------------------
Tomoya MORINAGA
OKI SEMICONDUCTOR CO., LTD.


> -----Original Message-----
> From: Jiri Slaby [mailto:[email protected]]
> Sent: Wednesday, April 20, 2011 12:06 AM
> To: Tomoya MORINAGA
> Cc: 'Jiri Slaby'; [email protected]; 'Jean
> Delvare'; [email protected]
> Subject: Re: [PATCH 5/7] I2C: eg20t, remove unused variable
>
> On 03/23/2011 11:50 AM, Tomoya MORINAGA wrote:
> > Hi Jiri,
> >
> > It looks OK.
> >
> > Signed-off-by: Tomoya MORINAGA <[email protected]>
>
> Hi, will somebody take it or should I resubmit?
>
> > Thanks,
> > -----------------------------------------
> > Tomoya MORINAGA
> > OKI SEMICONDUCTOR CO., LTD.
> >
> >> -----Original Message-----
> >> From: [email protected]
> >> [mailto:[email protected]] On Behalf Of Jiri Slaby
> >> Sent: Wednesday, March 23, 2011 5:50 PM
> >> To: [email protected]
> >> Cc: [email protected]; Jiri Slaby; Jean Delvare;
> >> [email protected]
> >> Subject: [PATCH 5/7] I2C: eg20t, remove unused variable
> >>
> >> 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 <[email protected]>
> >> Cc: Jean Delvare <[email protected]>
> >> Cc: [email protected]
> >> ---
> >> drivers/i2c/busses/i2c-eg20t.c | 8 --------
> >> 1 files changed, 0 insertions(+), 8 deletions(-)
> >>
> >> 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),
> >> --
> >> 1.7.4.1
> >>
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe
> >> linux-kernel" in the body of a message to
> [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> Please read the FAQ at http://www.tux.org/lkml/
> >>
> >
>
>
> --
> js
>