public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Hongbo Yao <yaohongbo@huawei.com>
Cc: haver@linux.ibm.com, arnd@arndb.de, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: genwqe: fix compile warnings
Date: Thu, 5 Dec 2019 12:45:09 +0100	[thread overview]
Message-ID: <20191205114509.GA362619@kroah.com> (raw)
In-Reply-To: <20191205111655.170382-1-yaohongbo@huawei.com>

On Thu, Dec 05, 2019 at 07:16:55PM +0800, Hongbo Yao wrote:
> Using the following command will get compile warnings:
> make W=1 drivers/misc/genwqe/card_ddcb.o ARCH=x86_64
> 
> drivers/misc/genwqe/card_ddcb.c: In function setup_ddcb_queue:
> drivers/misc/genwqe/card_ddcb.c:1024:6: warning: variable rc set but not
> used [-Wunused-but-set-variable]
> drivers/misc/genwqe/card_ddcb.c: In function genwqe_card_thread:
> drivers/misc/genwqe/card_ddcb.c:1190:23: warning: variable rc set but
> not used [-Wunused-but-set-variable]
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Hongbo Yao <yaohongbo@huawei.com>
> ---
>  drivers/misc/genwqe/card_ddcb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c
> index 026c6ca24540..905106579935 100644
> --- a/drivers/misc/genwqe/card_ddcb.c
> +++ b/drivers/misc/genwqe/card_ddcb.c
> @@ -1084,7 +1084,7 @@ static int setup_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue)
>  				queue->ddcb_daddr);
>  	queue->ddcb_vaddr = NULL;
>  	queue->ddcb_daddr = 0ull;
> -	return -ENODEV;
> +	return rc;
>  
>  }
>  
> @@ -1179,7 +1179,7 @@ static irqreturn_t genwqe_vf_isr(int irq, void *dev_id)
>   */
>  static int genwqe_card_thread(void *data)
>  {
> -	int should_stop = 0, rc = 0;
> +	int should_stop = 0;
>  	struct genwqe_dev *cd = (struct genwqe_dev *)data;
>  
>  	while (!kthread_should_stop()) {
> @@ -1187,12 +1187,12 @@ static int genwqe_card_thread(void *data)
>  		genwqe_check_ddcb_queue(cd, &cd->queue);
>  
>  		if (GENWQE_POLLING_ENABLED) {
> -			rc = wait_event_interruptible_timeout(
> +			wait_event_interruptible_timeout(
>  				cd->queue_waitq,
>  				genwqe_ddcbs_in_flight(cd) ||
>  				(should_stop = kthread_should_stop()), 1);
>  		} else {
> -			rc = wait_event_interruptible_timeout(
> +			wait_event_interruptible_timeout(
>  				cd->queue_waitq,
>  				genwqe_next_ddcb_ready(cd) ||
>  				(should_stop = kthread_should_stop()), HZ);

Why ignore the return value of these functions?

SHouldn't you fix the code to handle it properly?

thanks,

greg k-h

      reply	other threads:[~2019-12-05 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 11:16 [PATCH] misc: genwqe: fix compile warnings Hongbo Yao
2019-12-05 11:45 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205114509.GA362619@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=haver@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=yaohongbo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox