🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: org.kernel.vger.linux-kbuild
Article #1

Re: [PATCH v3 1/5] modpost: Use for() loop

#1
From: Masahiro Yamada
Date: Fri, 09 May 2025 00:47
46 lines
5975 bytes
On Fri, May 2, 2025 at 11:25 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> Slight cleanup by using a for() loop instead of while(). This makes it
> clearer what is the iteration and what is the actual work done.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  scripts/mod/modpost.c |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied to linux-kbuild.
Thanks.



> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1595,12 +1595,10 @@ static void read_symbols(const char *mod
>                         license = get_next_modinfo(&info, "license", license);
>                 }
>
> -               namespace = get_modinfo(&info, "import_ns");
> -               while (namespace) {
> +               for (namespace = get_modinfo(&info, "import_ns");
> +                    namespace;
> +                    namespace = get_next_modinfo(&info, "import_ns", namespace))
>                         add_namespace(&mod->imported_namespaces, namespace);
> -                       namespace = get_next_modinfo(&info, "import_ns",
> -                                                    namespace);
> -               }
>
>                 if (!get_modinfo(&info, "description"))
>                         warn("missing MODULE_DESCRIPTION() in %s\n", modname);
>
>


-- 
Best Regards
Masahiro Yamada
Technical Details
Message-ID: <CAK7LNARCQ6_yWiUCwVLEAeqJ_zN4pw73uLaJ7pWd02dqiSDa4w@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nntp.lore.kernel.org!not-for-mail
References: <20250502141204.500293812@infradead.org> <20250502141843.937580735@infradead.org>

Show Full Headers
Complete Article Headers
Message-ID: <CAK7LNARCQ6_yWiUCwVLEAeqJ_zN4pw73uLaJ7pWd02dqiSDa4w@mail.gmail.com>
Subject: Re: [PATCH v3 1/5] modpost: Use for() loop
Date: Fri, 9 May 2025 09:47:18 +0900
From: Masahiro Yamada <masahiroy@kernel.org>
References: <20250502141204.500293812@infradead.org> <20250502141843.937580735@infradead.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!nntp.lore.kernel.org!not-for-mail
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EA1B3FC7;
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal: ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
 t=1746751676; cv=none; b=FyKpqqfkzsT9d9EQ1L0MuRt8mfgPg/yomSjPIDgBPqNmPMhoT7YsDAX5xcQE+yRkGJw9St2sb1WjJ0biGhea6C8pgH3a43jMkIrYGDZdYB69AEUs/il7TozE0B2FiIOLoU0Mq0V/aUEYtGSfaOWrmc6AaF1hoe5QtpjGu3Hwikk=
ARC-Message-Signature: ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
 s=arc-20240116; t=1746751676; c=relaxed/simple;
 bh=bMakgoMCuiRE72u/z+hJBAzxNQv9g+Mt/nWMliQW9cs=;
 h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
 To:Cc:Content-Type; b=gFgE3SYqK5wG7zWyrK3dfTI3ptOp8i0iE4B+45X5mA1Z+4Gx2PiV73+V/9e8lpU9Ne5Ucag/Iqh95xd4wQNXB5PFQMlxWBag6x6GBnTY6JvG+OYCgQpPjFOysgr3pg+0Dfpd9u5G+qEbwQAHvJq7pSJRkrMcSDlcphkmbwy1WNQ=
ARC-Authentication-Results: ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XhYED6Sd; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
 dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XhYED6Sd"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3DB3C4CEE7;
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
 s=k20201202; t=1746751675;
 bh=bMakgoMCuiRE72u/z+hJBAzxNQv9g+Mt/nWMliQW9cs=;
 h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
 b=XhYED6Sd5TjEoox6RCu60AkqsdrkeQ+XbMCsWxO/VYqx0YuIemCzYjffuEbFIIftg
 1XdkJ+J4CJoMBOa+uIzdTRvzJ+niJ3nv9TcBdvpaMWYEJ0CsiJmAhPPpBQubTxU6e+
 juZ793W+uXqvPi6zYeqJXEoIzBxLXzJF8LI3HFKGF8WhhpdXxTHhKXcF0uvAUazKkg
 yTLG/9gljKa2TwdIhKPRjNodB2pQk2+O3POiu+WV4j0EHtd8yYRm31bx2SGFe6RdpE
 +cCrGbklk3lLBixRS2mcB//FkiDIOQSjds3fI0sH9co/to1gBySjSmqWUr36M8PmJY
 aVPjo+eI2EJbg==
Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-54b10956398so793193e87.0;
X-Forwarded-Encrypted: i=1; AJvYcCUvgH76pF8RJL1sBG4qBIET830lUTAhZyVTpGAUgO15aRkEhE7C3B6gikOqXSLxG/m6AUtQvpjtTpnlWal0VA==@vger.kernel.org, AJvYcCVKzrG4e4vt8NSerdnleFtIz8UX+GXfwFSjZVtNe3K/W/DxeRAV7SNmLrVzmZfWV1jqWtY4r+8kTbgA7g0=@vger.kernel.org, AJvYcCXS0/WUOyk34oW5JTUlVNOPfMZ83e7IQWr8mVaGnxlElXHQYcMpGsackt6XE+Dy48rI4hb3EEZs9pxEZ1ti@vger.kernel.org
X-Gm-Message-State: AOJu0YxqhSFSEjA/UQoAxZQfFH2Jv49Pp8NGGX981uPb9SqPTAMedn2C
 DXOZCNJO98liZpitbyV9s+THQSY5IGl7TMqXHt6gsXSUUKf9by+wS4BBGcz/awoG9HhAsGK+7aO
 BIVax8anM2WuOHuCn4kpQaG+qLII=
X-Received: by 2002:a05:6512:6094:b0:549:7c5f:d961 with SMTP id
 2adb3069b0e04-54fc679583amr418503e87.17.1746751674642; Thu, 08 May 2025
Precedence: bulk
X-Mailing-List: linux-modules@vger.kernel.org
List-Id: <linux-modules.vger.kernel.org>
List-Subscribe: <mailto:linux-modules+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-modules+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
In-Reply-To: <20250502141843.937580735@infradead.org>
X-Gmail-Original-Message-ID: <CAK7LNARCQ6_yWiUCwVLEAeqJ_zN4pw73uLaJ7pWd02dqiSDa4w@mail.gmail.com>
X-Gm-Features: ATxdqUGI3Y68vP87Uwm_DYEQHZajtw-tHyZdm5jP7oRxwSU3uhUsZJ1CM3C6U2o
To: Peter Zijlstra <peterz@infradead.org>
Cc: mcgrof@kernel.org, x86@kernel.org, hpa@zytor.com, petr.pavlu@suse.com,
 samitolvanen@google.com, da.gomez@samsung.com, nathan@kernel.org, 
 nicolas@fjasle.eu, linux-kernel@vger.kernel.org, 
 linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, 
 hch@infradead.org, gregkh@linuxfoundation.org, roypat@amazon.co.uk
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Newsgroups: org.kernel.vger.linux-modules,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel