All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: serial: 8250: remove set but unused variable
@ 2019-12-05 12:11 Xiongfeng Wang
  2019-12-05 12:22 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Xiongfeng Wang @ 2019-12-05 12:11 UTC (permalink / raw)
  To: gregkh, jslaby; +Cc: linux-serial, linux-kernel, huawei.libin, wangxiongfeng2

Fix the following warning:
drivers/tty/serial/8250/serial_cs.c: In function multi_config:
drivers/tty/serial/8250/serial_cs.c:562:7: warning: variable err set but not used [-Wunused-but-set-variable]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 drivers/tty/serial/8250/serial_cs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index c8186a0..eeda6a0 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -559,16 +559,13 @@ static int multi_config(struct pcmcia_device *link)
 	 */
 	if (info->manfid == MANFID_OXSEMI || (info->manfid == MANFID_POSSIO &&
 				info->prodid == PRODID_POSSIO_GCC)) {
-		int err;
-
 		if (link->config_index == 1 ||
 		    link->config_index == 3) {
-			err = setup_serial(link, info, base2,
-					link->irq);
+			setup_serial(link, info, base2, link->irq);
 			base2 = link->resource[0]->start;
 		} else {
-			err = setup_serial(link, info, link->resource[0]->start,
-					link->irq);
+			setup_serial(link, info, link->resource[0]->start,
+				     link->irq);
 		}
 		info->c950ctrl = base2;
 
-- 
1.7.12.4


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

* Re: [PATCH] tty: serial: 8250: remove set but unused variable
  2019-12-05 12:11 [PATCH] tty: serial: 8250: remove set but unused variable Xiongfeng Wang
@ 2019-12-05 12:22 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-12-05 12:22 UTC (permalink / raw)
  To: Xiongfeng Wang; +Cc: jslaby, linux-serial, linux-kernel, huawei.libin

On Thu, Dec 05, 2019 at 08:11:43PM +0800, Xiongfeng Wang wrote:
> Fix the following warning:
> drivers/tty/serial/8250/serial_cs.c: In function multi_config:
> drivers/tty/serial/8250/serial_cs.c:562:7: warning: variable err set but not used [-Wunused-but-set-variable]
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> ---
>  drivers/tty/serial/8250/serial_cs.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
> index c8186a0..eeda6a0 100644
> --- a/drivers/tty/serial/8250/serial_cs.c
> +++ b/drivers/tty/serial/8250/serial_cs.c
> @@ -559,16 +559,13 @@ static int multi_config(struct pcmcia_device *link)
>  	 */
>  	if (info->manfid == MANFID_OXSEMI || (info->manfid == MANFID_POSSIO &&
>  				info->prodid == PRODID_POSSIO_GCC)) {
> -		int err;
> -
>  		if (link->config_index == 1 ||
>  		    link->config_index == 3) {
> -			err = setup_serial(link, info, base2,
> -					link->irq);
> +			setup_serial(link, info, base2, link->irq);
>  			base2 = link->resource[0]->start;
>  		} else {
> -			err = setup_serial(link, info, link->resource[0]->start,
> -					link->irq);
> +			setup_serial(link, info, link->resource[0]->start,
> +				     link->irq);

Again, why ignore the error value?

greg k-h

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

end of thread, other threads:[~2019-12-05 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 12:11 [PATCH] tty: serial: 8250: remove set but unused variable Xiongfeng Wang
2019-12-05 12:22 ` Greg KH

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.