From patchwork Tue Oct 29 12:38:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 178023 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4815367ill; Tue, 29 Oct 2019 05:38:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsiCIYNSlrmzkg+VZZA2aVqfLEvqDXKmXVF59Z8YSUuUBUiKLXST5vTz5a6TG+Geok+jSX X-Received: by 2002:aa7:d714:: with SMTP id t20mr25952007edq.129.1572352729368; Tue, 29 Oct 2019 05:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572352729; cv=none; d=google.com; s=arc-20160816; b=Y9Vx/b5oi91YAB3XPU41uKyf+ww96S9fIDYiidKUNy2yLABZ0Em0WglWUPkbeZeKJB c7owSKHCSY+U4BpW6t9zVsqtfFgMc596l+Q9M+dhyw8o9JIeuBDT56AVyDxe37SNCqYP pNb1oczePF17VQMm+adKjpiuHIhm1WyB+nASq5WH3XdnNIhYk52lNpVwxMXcAJaLfmMX U6RQF5wPfyRTj+jl4kFBxHn4ysjdeGvcscYLJODhuN3zqq6/ehAKMEhODwEckhttsiWC AxiOf1W0ykBATGUIUY2G0N8Qa+OE6f3mFRYUFl2oipmk6ioh78ecOh2ULWwZ25p9NrlV QX7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=rRs8Ed7t4bAer/X1dc9tlKv3gE2rP5G57gkcJJvIIzs=; b=Tl/ZyjISVy7u/m2Xgyxl3Rr1IU60IyHV0WyousS1gixOL8PsZZXoDrouFvwXcfvh1H uvzow4yNwAzrldHV5Pjn2u+leMOA9Gdxmi9ySQ7oOKHex2WyHdTFdTJ3lz7prWRJ5TQJ Jhkdl3+zBjeZtMuzPjN7OMUy3W165MKPdKXfCujfzZeuW3A3yAaFRq8YJqMQAS4cZZje BTfK4UGt6tzeSBc2r3ck24v617GmybcVL4L3I/FYsbMPvhiTFRRSLFYJ+WSpczJyvawi thxjSqS4Uba9ud4Mt2DH0fAFUZw+ugI3A0EP+I7uyEJI7kczWLZ+KdfuKpE1FTNokcWz aRFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Wx5lpNCA; 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 c36si9730236edb.58.2019.10.29.05.38.49; Tue, 29 Oct 2019 05:38:49 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Wx5lpNCA; 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 S1728390AbfJ2Min (ORCPT + 26 others); Tue, 29 Oct 2019 08:38:43 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:33928 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbfJ2Min (ORCPT ); Tue, 29 Oct 2019 08:38:43 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x9TCcFU9026616; Tue, 29 Oct 2019 21:38:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x9TCcFU9026616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1572352702; bh=rRs8Ed7t4bAer/X1dc9tlKv3gE2rP5G57gkcJJvIIzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wx5lpNCAWh0/fyhSglgPtgut//wljqNN4vx7Lbqx1ZhuPpRivg83hoCLnyCcntuzu U9RPsoIpsytpjbkToeJY+5WYt82+HYbs0pJd3BtbJMfMcBPcgOHuPZ2a+NbVs/4KBY AKaFq3Ky3cZ2t+BemZLqYWnSPrH/mekrlSpwcMCUWODxeoUYzmpnP8MVzO2qdSAZdt s27bGUd7tePUX8QCrh9dwaykFQx/SvgZ/ao/EBBNfww0FW6fZ59oWvrTJFa6Sda5U6 aU/iw2JlhQxBCOIFNY5eUHLyP/Je4/BknAL4de9oZJP9A5eA20yaCwVQIkIN8cP014 Qgm4BCvojQSxw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jessica Yu , Matthias Kaehlcke , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] mospost: remove unneeded local variable in contains_namespace() Date: Tue, 29 Oct 2019 21:38:09 +0900 Message-Id: <20191029123809.29301-5-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029123809.29301-1-yamada.masahiro@socionext.com> References: <20191029123809.29301-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The local variable, ns_entry, is unneeded. While I was here, I also cleaned up the comparison with NULL or 0. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 Reviewed-by: Matthias Maennich diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index f7425f5d4ab0..f70b924f379f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -239,10 +239,8 @@ static struct symbol *find_symbol(const char *name) static bool contains_namespace(struct namespace_list *list, const char *namespace) { - struct namespace_list *ns_entry; - - for (ns_entry = list; ns_entry != NULL; ns_entry = ns_entry->next) - if (strcmp(ns_entry->namespace, namespace) == 0) + for (; list; list = list->next) + if (!strcmp(list->namespace, namespace)) return true; return false;