Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp465136imu; Tue, 27 Nov 2018 15:28:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJlNSvTIXQtpkIzP3jxenzk5rmgWDwrtUpmQkh3UUMuWB+TVXNgtsue9+o+zYWrnmeOPoC X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr14506096pls.281.1543361294616; Tue, 27 Nov 2018 15:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543361294; cv=none; d=google.com; s=arc-20160816; b=IOzK7jxcpDXwqmbbjwvZG6SSZmHH9wRz+rY///J3TtZ5c5kyVA9MazaoxwH283aUz6 PquExd/GOYPBV9GZdfGsMEnEcGamHH8CnxkbbAEp99NyXwVTH6CNB3D/cCXQ2lb6uRpl r+AIIPskOd7lbN8zR0+UF5uBNUFrk7ipsFSR6eves/QLVkrgKuCjWvTir8TBljlFncEL EWtITXMYq1nwvH10fVWlTHx1NwTBsj0BbwcaS9ElAiIy6fTMthomzE/oUJ9Km31JRRtP 0bmDlgApK1R/VoR4+mLz0AX/lIsDZOSwLzQIMqbaoiob2L1/1UVosmHu2NcF5s3/mQMG IDmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=JJbkcV0r2yaU0hO8rwK4SjhJU8OHUF+z0hFKQME1fbk=; b=IE8JxQ/O6MrjFXLEwmhf2nimWjCuA+hbn5BPfayYMm+7Oj6pIK34kuqr6otfHGhzVc 6hUK20m4UZh0XOnQnANaQUlHROY2x8cElDMBRJEYn28lRQgZ+LaYbuzPhRvCe0PzN77d Rn6cULF7SjyS22CLqy/XcRT++8+GYsLf7SGJ5y082BzV9wvFtoZm2QptWWZp7qgDJlOt DmXuM5dThD05by8YfUw4jk0M7mch7e6wdmsnv2vL8RHCCEjKTSFMEN5f451SN+E/yw3N +DOpd6oVX9/naweZHt8kGyc7eE5yd5HjzUrcATBYkj87ZAyDZeLUP1OPqrA/FIo65zLL MJSg== ARC-Authentication-Results: i=1; mx.google.com; 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 t136si6360527pfc.262.2018.11.27.15.27.58; Tue, 27 Nov 2018 15:28:14 -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; 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 S1726705AbeK1KZK (ORCPT + 99 others); Wed, 28 Nov 2018 05:25:10 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:45644 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbeK1KZK (ORCPT ); Wed, 28 Nov 2018 05:25:10 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2E3F114E09804; Tue, 27 Nov 2018 15:25:40 -0800 (PST) Date: Tue, 27 Nov 2018 15:25:39 -0800 (PST) Message-Id: <20181127.152539.1127313634090592618.davem@davemloft.net> To: yuehaibing@huawei.com Cc: igor.russkikh@aquantia.com, nikita.danilov@aquantia.com, yana.esina@aquantia.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next] net: aquantia: return 'err' if set MPI_DEINIT state fails From: David Miller In-Reply-To: <20181124101641.7072-1-yuehaibing@huawei.com> References: <20181124101641.7072-1-yuehaibing@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 27 Nov 2018 15:25:40 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing Date: Sat, 24 Nov 2018 18:16:41 +0800 > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:260:7: > warning: variable 'err' set but not used [-Wunused-but-set-variable] > > 'err' should be returned while set MPI_DEINIT state fails > in hw_atl_utils_soft_reset. > > Fixes: cce96d1883da ("net: aquantia: Regression on reset with 1.x firmware") > Signed-off-by: YueHaibing Applied. But this AQ_HW_STATE_FOR macro _MUST_ be fixed. No macro should have invisible references to variables like this, and that is exactly what leads to bugs like this. CPP macros written this way make it impossible to properly audit code. 'err' should be an explicit argument given to this function instead of how it works now.