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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e06cb7f5-7aa3-464c-a8a1-2c7b9b6a29eb@web.de>
Date: Thu, 30 Jan 2025 12:01:03 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: cocci@...ia.fr, kernel-janitors@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, linux-block@...r.kernel.org,
 linux-btrfs@...r.kernel.org, linux-ide@...r.kernel.org,
 linux-nvme@...ts.infradead.org, linux-pm@...r.kernel.org,
 linux-rdma@...r.kernel.org, linux-scsi@...r.kernel.org,
 linux-sound@...r.kernel.org, linux-spi@...r.kernel.org,
 linux-xfs@...r.kernel.org, ceph-devel@...r.kernel.org,
 platform-driver-x86@...r.kernel.org, dri-devel@...ts.freedesktop.org,
 ibm-acpi-devel@...ts.sourceforge.net, imx@...ts.linux.dev,
 kernel@...gutronix.de, linux-arm-kernel@...ts.infradead.org,
 Andrew Morton <akpm@...ux-foundation.org>, Carlos Maiolino <cem@...nel.org>,
 Chris Mason <clm@...com>, Christoph Hellwig <hch@....de>,
 Damien Le Moal <dlemoal@...nel.org>, "Darrick J. Wong" <djwong@...nel.org>,
 David Sterba <dsterba@...e.com>, Dick Kennedy <dick.kennedy@...adcom.com>,
 Dongsheng Yang <dongsheng.yang@...ystack.cn>,
 Easwar Hariharan <eahariha@...ux.microsoft.com>,
 Fabio Estevam <festevam@...il.com>, Frank Li <Frank.Li@....com>,
 Hans de Goede <hdegoede@...hat.com>,
 Henrique de Moraes Holschuh <hmh@....eng.br>,
 James Bottomley <James.Bottomley@...senPartnership.com>,
 James Smart <james.smart@...adcom.com>, Jaroslav Kysela <perex@...ex.cz>,
 Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>,
 Josef Bacik <josef@...icpanda.com>, Julia Lawall <Julia.Lawall@...ia.fr>,
 Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
 Ilya Dryomov <idryomov@...il.com>,
 Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>,
 Keith Busch <kbusch@...nel.org>, Leon Romanovsky <leon@...nel.org>,
 Mark Brown <broonie@...nel.org>,
 "Martin K. Petersen" <martin.petersen@...cle.com>,
 Nicolas Palix <nicolas.palix@...g.fr>, Niklas Cassel <cassel@...nel.org>,
 Oded Gabbay <ogabbay@...nel.org>, Ricardo Ribalda <ribalda@...gle.com>,
 Sagi Grimberg <sagi@...mberg.me>, Sascha Hauer <s.hauer@...gutronix.de>,
 Sebastian Reichel <sre@...nel.org>,
 Selvin Xavier <selvin.xavier@...adcom.com>, Shawn Guo <shawnguo@...nel.org>,
 Shyam Sundar S K <Shyam-sundar.S-k@....com>, Takashi Iwai <tiwai@...e.com>,
 Victor Gambier <victor.gambier@...ia.fr>, Xiubo Li <xiubli@...hat.com>,
 Yaron Avizrat <yaron.avizrat@...el.com>
Subject: Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch
 expressions too

> Teach the script to suggest conversions for timeout patterns where the
> arguments to msecs_to_jiffies() are expressions as well.

Does anything hinder to benefit any more from a source code analysis approach
(like the following by the extended means of the semantic patch language)?


// SPDX-License-Identifier: GPL-2.0
/// Simplify statements by using a known wrapper macro.
/// Replace selected msecs_to_jiffies() calls by secs_to_jiffies().
//
// Keywords: wrapper macro conversion secs seconds jiffies
// Confidence: High
// Options: --no-includes --include-headers

virtual context, patch, report, org

@depends on context@
expression e;
@@
*msecs_to_jiffies
 (
(e * 1000
|e * MSEC_PER_SEC
)
 )

@depends on patch@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
 (
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
 )

@x depends on org || report@
expression e;
position p;
@@
 msecs_to_jiffies@p
 (
(e * 1000
|e * MSEC_PER_SEC
)
 )

@script:python depends on org@
p << x.p;
@@
coccilib.org.print_todo(p[0], "WARNING: opportunity for secs_to_jiffies()")

@script:python depends on report@
p << x.p;
@@
coccilib.report.print_report(p[0], "WARNING: opportunity for secs_to_jiffies()")


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ