Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1577669ybl; Thu, 5 Dec 2019 03:46:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxhxDWJnttzhhu2gMHNlc5m9FnVchlsD17GcQGJDGETOhu+i6y+HPMTdklMS+JhyAU/h7L1 X-Received: by 2002:a9d:1b3:: with SMTP id e48mr6354958ote.341.1575546360066; Thu, 05 Dec 2019 03:46:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575546360; cv=none; d=google.com; s=arc-20160816; b=j5qBXWO6V3BN8aBJeU3ptHh2dEAFZ6C918/KcUXmmkV6XJzsbPeTu3hKdtqa/EMjw1 iEP09kuy73+XY8CDtmaJscmi5xcbrL3TwUz4jzN8iJMBUi4Fqe3tfp0h7JXqB+BUyQ99 qZf/KExDdWDHOTVe5vrKUVaOsHlOBFiOgfx30uM5apTNb0sL4qt09LwvbVfIxDUoFh8F utbq9HT2k/R4eSSXwIE9BV4FnjH4p2R6W4tmpLlCfZrG3Pi5r11/sYamTTKFGZM9HJMH X69I1YllK5/FVJOwLRAz3Gh9ZeNKHHeYkiK5e4kUfj9CiIYT+iIXd2A/4XuGmKOTzziz 31wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AkuNzMPFySerbDmAiKADUnLu3WJPLY7kds1YmgC0Aac=; b=WVUupcSzgcmotmy763ociBLtmgLRm7I/+sMnUjYL1YkJUwo2A78hy5BPiIYyXUDYGK RdBCAnQOhsi1yv0knl5NkycIGkfY57iCnm1JlYszWvGeahfIUEXc7POpEwFTCmIg7DOz 2QL4n6I9a4eArG/pLE8QeyweAVJiB4DpX6ipB+FKnI6wqDiY/r4j5dvQi+wW7yoc9OFA Gh7oVaW2wvcRDYROMJNeVSklFJ3iGHdzbayFz+aa7z0aSQDcR5mbYcpPf8LTrt3PyLl+ aY9/tHowK7A9ECsL6Whh0LemYjDySfNALZjog4GPs/e6fN2gw9w7ZC12l8XG6XrdvlFN YfJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SX5oS6Kc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si4680649oig.84.2019.12.05.03.45.47; Thu, 05 Dec 2019 03:46:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SX5oS6Kc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbfLELpQ (ORCPT + 99 others); Thu, 5 Dec 2019 06:45:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:45732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729109AbfLELpO (ORCPT ); Thu, 5 Dec 2019 06:45:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6914224F8; Thu, 5 Dec 2019 11:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575546313; bh=MMPufC6YNe0Yck6ySDeWIGIg8ontQHPmLYnxR8od234=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SX5oS6KcWCEiCqZIzt7RAiWRdxKT6nfCx1zO5pzXJ5Zu60h3W0CAqCN20iC2H9Nh/ il+55z3bS10BFwauWeeEureRuZQPq93H/Ym3GxEO1IqtbhNCQWUJ4/djOX9ni/on+9 ICwEbRzk5a8sc/QAuAPnSSNrTvz0Oqm23MSUBkqk= Date: Thu, 5 Dec 2019 12:45:09 +0100 From: Greg KH To: Hongbo Yao Cc: haver@linux.ibm.com, arnd@arndb.de, linuxarm@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] misc: genwqe: fix compile warnings Message-ID: <20191205114509.GA362619@kroah.com> References: <20191205111655.170382-1-yaohongbo@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205111655.170382-1-yaohongbo@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Hongbo Yao > --- > 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