lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1be0efc-a4c9-461d-a01a-8fb830b2c68d@web.de>
Date: Wed, 23 Apr 2025 13:01:03 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Luo Jie <quic_luoj@...cinc.com>, cocci@...ia.fr,
 linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
 Catalin Marinas <catalin.marinas@....com>, Joey Gouly <joey.gouly@....com>,
 Julia Lawall <Julia.Lawall@...ia.fr>, Marc Zyngier <maz@...nel.org>,
 Nicolas Palix <nicolas.palix@...g.fr>, Oliver Upton
 <oliver.upton@...ux.dev>, Rasmus Villemoes <linux@...musvillemoes.dk>,
 Suzuki Poulouse <suzuki.poulose@....com>, Will Deacon <will@...nel.org>,
 Yury Norov <yury.norov@...il.com>, Zenghui Yu <yuzenghui@...wei.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>,
 "Kiran Kumar C.S.K" <quic_kkumarcs@...cinc.com>,
 Lei Wei <quic_leiwei@...cinc.com>, Pavithra R <quic_pavir@...cinc.com>,
 Suruchi Agarwal <quic_suruchia@...cinc.com>, quic_linchen@...cinc.com
Subject: Re: [cocci] [PATCH v3 2/6] coccinelle: misc: Add field_modify script

> This script finds and suggests conversions of opencoded field
> modify patterns with the wrapper FIELD_MODIFY() API defined in
> include/linux/bitfield.h for better readability.

See also:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.15-rc3#n94


…
> +++ b/scripts/coccinelle/misc/field_modify.cocci
> @@ -0,0 +1,24 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +///

I suggest to omit a blank comment line here.


> +/// Replaced below code with the wrapper FIELD_MODIFY(MASK, &reg, val)

Replace?


…
> +// Copyright (C) 2025 Qualcomm Innovation Center, Inc.

Copyright: ?


> +// URL: https://coccinelle.gitlabpages.inria.fr/website

I suggest to omit such information here.


…
> +virtual patch

How do you think about to support additional operation modes?


…
> +- reg &= ~mask;
> +- reg |= FIELD_PREP(mask, val);
> ++ FIELD_MODIFY(mask, &reg, val);

Would you like to integrate the following SmPL code variant?

-reg &= ~mask;
-reg |= FIELD_PREP
+       FIELD_MODIFY
                  (mask,
+                  &reg,
                   val
                  );


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ