Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2123783imm; Thu, 27 Sep 2018 07:48:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61xdHjcZ9ip1cTnJZdWUtSjO+ATcDLqDWKFBCWvQ4KHJZ82IvnnBj7WDYj2Wr433f/cRvAg X-Received: by 2002:a17:902:b7c2:: with SMTP id v2-v6mr11544092plz.238.1538059690843; Thu, 27 Sep 2018 07:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538059690; cv=none; d=google.com; s=arc-20160816; b=L+vDr96tHFSqAfPEN8KFJn65t1Wf/Sb82HHcVSUJaaWb39gwktGeRtrupQb5/9xxy0 D0VOPSfhK6AjYm4wY0Ue+1WxNEY+vUnZomtawyJ6oluM0M1GwPtZ2j3Wvdsg2bvgaTuO kxJRAE38hAUYnT6akUgVIRtxi1n7Ym1MkJiMS6Q/GPIYIiZekB+MjUEc97lJ2k5zgVKP lC/nvdE9R5Ttla2ymO4bC+pvEjpcrz602FvaL8q4FkQsqIYS8pVvPZUr9xfNHbwmwedu QRc0GUf6BLaiJvgYtyatY8vvRzyk0k62o0+tQvNnRFawW1ZqR6+VrmrVmPr12njFhD3F cq2Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=41CiW0aD1Y10mpO80vDg21ZJZ4K/OqngEm3RQICaN20=; b=sNTTIxIrGOUMG1wq2YR5DnOTXGkRvDCTbK8BIFqx0CmXknOxk4qufw2hs0o9Qgh6Z3 QpCbovFPY1Jbr5/jYy8KDQ4SrCBx7DBIBCJO+muX2ielNEW9MdgbVFcc1FGLcua4rMKI KXrDukggyLjQSRJpcxqjVH8feajnJW4ai/fmFneLozd16qYnYgunyqMfXJtPmKiQFpos qtUtX02Olu1WM8O1bmekMy2wI08ELu9IS/1lmaO3k8zMBqsOPS6m00nYMv2cgbkJTAoe dFDX2PuPOtNoZ4cfxYUOh4YjHnQyJHw8TVcKVTqrVnMVrYg5zQCnuN9caRvOdwONkfp3 GbMQ== 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 97-v6si2289389pld.124.2018.09.27.07.47.53; Thu, 27 Sep 2018 07:48:10 -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 S1727692AbeI0VGM (ORCPT + 99 others); Thu, 27 Sep 2018 17:06:12 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:50446 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727199AbeI0VGM (ORCPT ); Thu, 27 Sep 2018 17:06:12 -0400 Received: from localhost.localdomain (p200300E9D7234A78891558B353DFC2C9.dip0.t-ipconnect.de [IPv6:2003:e9:d723:4a78:8915:58b3:53df:c2c9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id B41D6C87C0; Thu, 27 Sep 2018 16:47:33 +0200 (CEST) Subject: Re: [PATCH] ieee802154: remove a redundant local variable 'i' To: zhong jiang , davem@davemloft.net Cc: alex.aring@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1537368097-60101-1-git-send-email-zhongjiang@huawei.com> From: Stefan Schmidt Message-ID: <42999ee5-20c2-5d2c-4ca3-e5bb8f5a3864@datenfreihafen.org> Date: Thu, 27 Sep 2018 16:47:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1537368097-60101-1-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. regards Stefan Schmidt