Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp387295imm; Thu, 27 Sep 2018 23:38:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV61jytQoR2v2F9XCeLqaLaw3oOQw2URki5RedOCoiu9b/dspqvNhMPDGaUJ7VR3+dJSHy6TD X-Received: by 2002:a17:902:830b:: with SMTP id bd11-v6mr14501213plb.249.1538116717517; Thu, 27 Sep 2018 23:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538116717; cv=none; d=google.com; s=arc-20160816; b=G139Ok/LntKqCjVjs6BHB70Z6F+zBpA7p9p2rok9sw2W3tx01C1oHPf/IpfgsPwp2c +rBG9saB52gGr1rOOPxYVBQTx29XG9drFVbXhxNfwcddq7Wh1OkBrcrUTtRzXRBp8mXB 30JunWxfFZA3F1ZeOUowgTIdzkGWWKv/h9Q8MDYydNHAxoO/OcrsP9TpPEbMyLbqM69O 2eYZNtocTO5a+2ZnNCe+mMRgm6o3QQD6qYPqWXYB+eBtzmdzrXEi8HgbaJvENYCykmdB 8GrJADMMr84regTziuhy+dP7Tyq+M1PL83LeZ115ClTSi1plABKSxh2EVVF5bBklC44U /zog== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=LbRsODoTKwuPOTUaE7MN0aEg7UPnCnM8clFttEmFi3U=; b=L1udDIREYGDOK/60jeaassimuEYKwipwziciGP5KIfYVloqbDKXDFj8ST7kwv0pWX5 RLg0FrXDqsoWjqMEde307Sz5Qkqg16bhPNv2x8MbkXhKori715wYQQef9dMS9Lzc4mU2 VIqwA0gQ7cNOLta6gy02UH4/25M2D+8cUvv8/xJlmRCX9hdGgC5OEjD8FWS6l0E+/J3C 0WlhUB2VVSVio6UXHGKomfH+JSLCXN0tYTid2ODd9UCIiMNP+aJIzwE4Nn+yGmp6hmXS TWi9XVSddvXp+mwrDvMmkVzRGeuZl9niBu7rV5QkgKsl7CmeyGYFrkISywgTUZZVc94v 5lIw== 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 j15-v6si3915840pgk.440.2018.09.27.23.38.20; Thu, 27 Sep 2018 23:38:37 -0700 (PDT) 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 S1728947AbeI1NAN (ORCPT + 99 others); Fri, 28 Sep 2018 09:00:13 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42677 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726060AbeI1NAM (ORCPT ); Fri, 28 Sep 2018 09:00:12 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6F0F7883A31E3; Fri, 28 Sep 2018 14:37:56 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.399.0; Fri, 28 Sep 2018 14:37:54 +0800 Message-ID: <5BADCC41.60702@huawei.com> Date: Fri, 28 Sep 2018 14:37:53 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Stefan Schmidt CC: , , , Subject: Re: [PATCH] ieee802154: remove a redundant local variable 'i' References: <1537368097-60101-1-git-send-email-zhongjiang@huawei.com> <42999ee5-20c2-5d2c-4ca3-e5bb8f5a3864@datenfreihafen.org> In-Reply-To: <42999ee5-20c2-5d2c-4ca3-e5bb8f5a3864@datenfreihafen.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/27 22:47, Stefan Schmidt wrote: > Hello. > > On 19/09/2018 16:41, zhong jiang wrote: >> The local variable 'i' is never used after being assigned. >> hence it should be redundant adn can be removed. >> >> Signed-off-by: zhong jiang >> --- >> net/ieee802154/nl802154.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c >> index 99f6c25..5b90151 100644 >> --- a/net/ieee802154/nl802154.c >> +++ b/net/ieee802154/nl802154.c >> @@ -445,7 +445,6 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev, >> { >> struct nlattr *nl_cmds; >> void *hdr; >> - int i; >> >> hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); >> if (!hdr) >> @@ -508,7 +507,6 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev, >> if (!nl_cmds) >> goto nla_put_failure; >> >> - i = 0; >> #define CMD(op, n) \ >> do { \ >> if (rdev->ops->op) { \ >> > Sorry, but this patch is wrong. The variable i is used in line 513 > inside the CMD() macro. The compiler clearly tells this when running > with your patch: > > net/ieee802154/nl802154.c: In function ‘nl802154_send_wpan_phy’: > net/ieee802154/nl802154.c:513:4: error: ‘i’ undeclared (first use in > this function) > > I would appreciate if patches sent out would at least be compile tested. Sorry, I really double check and compile test. Thanks, zhong jiang > regards > Stefan Schmidt > > . >