mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
@ 2025-01-29  8:06 Ricardo Ribalda
  2025-01-29  8:36 ` Markus Elfring
  2025-01-29 17:38 ` [PATCH] " Easwar Hariharan
  0 siblings, 2 replies; 11+ messages in thread
From: Ricardo Ribalda @ 2025-01-29  8:06 UTC (permalink / raw)
  To: Julia Lawall, Nicolas Palix, Andrew Morton, Easwar Hariharan
  Cc: cocci, linux-kernel, Ricardo Ribalda

When running cocci in report mode, eg:
$make coccicheck M="$dir" MODE=report

It returns this error:
virtual rule report not supported
coccicheck failed
make: *** [Makefile:251: __sub-make] Error 2

Create a dummy rule to avoid this error and run the other cocci scripts.

Fixes: 551dbd1ec7ff ("coccinelle: misc: add secs_to_jiffies script")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
index 8bbb2884ea5d..2d85dca16418 100644
--- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
+++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
@@ -10,6 +10,7 @@
 //
 
 virtual patch
+virtual report
 
 @depends on patch@ constant C; @@
 
@@ -20,3 +21,8 @@ virtual patch
 
 - msecs_to_jiffies(C * MSEC_PER_SEC)
 + secs_to_jiffies(C)
+
+// Dummy rule for report mode that would otherwise be empty and make spatch
+// fail ("No rules apply.")
+@script:python depends on report@
+@@

---
base-commit: 05dbaf8dd8bf537d4b4eb3115ab42a5fb40ff1f5
change-id: 20250129-secs_to_jiffles-26756c671f0b

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  8:06 [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report Ricardo Ribalda
@ 2025-01-29  8:36 ` Markus Elfring
  2025-01-29  8:40   ` Ricardo Ribalda
  2025-01-29 17:38 ` [PATCH] " Easwar Hariharan
  1 sibling, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2025-01-29  8:36 UTC (permalink / raw)
  To: Ricardo Ribalda, Easwar Hariharan, cocci
  Cc: LKML, kernel-janitors, Andrew Morton, Julia Lawall,
	Nicolas Palix, Victor Gambier

> When running cocci in report mode, eg:
> $make coccicheck M="$dir" MODE=report
>
> It returns this error:
> virtual rule report not supported
> coccicheck failed
> make: *** [Makefile:251: __sub-make] Error 2

I hope that more collateral evolution will happen because of such information.


> Create a dummy rule to avoid this error and run the other cocci scripts.

Please add proper support for operation modes around discussed source code analysis approaches.
Will it be more helpful to work with function calls like the following?

‣ coccilib.org.print_todo(p[0], "WARNING: opportunity for …")
‣ coccilib.report.print_report(p[0], "WARNING: opportunity for …")


Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  8:36 ` Markus Elfring
@ 2025-01-29  8:40   ` Ricardo Ribalda
  2025-01-29  8:46     ` Markus Elfring
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Ribalda @ 2025-01-29  8:40 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Easwar Hariharan, cocci, LKML, kernel-janitors, Andrew Morton,
	Julia Lawall, Nicolas Palix, Victor Gambier

Hi Markus

On Wed, 29 Jan 2025 at 09:37, Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > When running cocci in report mode, eg:
> > $make coccicheck M="$dir" MODE=report
> >
> > It returns this error:
> > virtual rule report not supported
> > coccicheck failed
> > make: *** [Makefile:251: __sub-make] Error 2
>
> I hope that more collateral evolution will happen because of such information.
>
>
> > Create a dummy rule to avoid this error and run the other cocci scripts.
>
> Please add proper support for operation modes around discussed source code analysis approaches.
> Will it be more helpful to work with function calls like the following?

My main concern is to fix the CI that was broken when this semantic
patch was introduced.

I am sure that a person more capable on cocci patches can implement
the report mode in a follow-up patch.

Regards!

>
> ‣ coccilib.org.print_todo(p[0], "WARNING: opportunity for …")
> ‣ coccilib.report.print_report(p[0], "WARNING: opportunity for …")
>
>
> Regards,
> Markus



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  8:40   ` Ricardo Ribalda
@ 2025-01-29  8:46     ` Markus Elfring
  2025-01-29  9:51       ` Victor Gambier
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Elfring @ 2025-01-29  8:46 UTC (permalink / raw)
  To: Ricardo Ribalda, Easwar Hariharan, cocci
  Cc: LKML, kernel-janitors, Andrew Morton, Julia Lawall,
	Nicolas Palix, Victor Gambier

>>> Create a dummy rule to avoid this error and run the other cocci scripts.
>>
>> Please add proper support for operation modes around discussed source code analysis approaches.
>> Will it be more helpful to work with function calls like the following?
>
> My main concern is to fix the CI that was broken when this semantic
> patch was introduced.
>
> I am sure that a person more capable on cocci patches can implement
> the report mode in a follow-up patch.

I prefer to avoid a temporary workaround when a more useful solution
is actually simple.

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  8:46     ` Markus Elfring
@ 2025-01-29  9:51       ` Victor Gambier
  2025-01-29  9:56         ` Markus Elfring
  2025-01-31 10:05         ` Markus Elfring
  0 siblings, 2 replies; 11+ messages in thread
From: Victor Gambier @ 2025-01-29  9:51 UTC (permalink / raw)
  To: Markus Elfring, Ricardo Ribalda, Easwar Hariharan, cocci
  Cc: LKML, kernel-janitors, Andrew Morton, Julia Lawall, Nicolas Palix

Thanks for the patch :)

On 29/01/2025 09:46, Markus Elfring wrote:
> I prefer to avoid a temporary workaround when a more useful solution
> is actually simple.

Markus, this is not helpful. Either provide a fully working example or 
stop nitpicking useful patches for projects you don't maintain.

Victor



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  9:51       ` Victor Gambier
@ 2025-01-29  9:56         ` Markus Elfring
  2025-01-31 10:05         ` Markus Elfring
  1 sibling, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2025-01-29  9:56 UTC (permalink / raw)
  To: Victor Gambier, Ricardo Ribalda, Easwar Hariharan, cocci
  Cc: LKML, kernel-janitors, Andrew Morton, Julia Lawall, Nicolas Palix

>> I prefer to avoid a temporary workaround when a more useful solution
>> is actually simple.
>
> Markus, this is not helpful.

I got an other impression


> Either provide a fully working example

I contributed some demonstrations for selected data processing approaches.


> or stop nitpicking useful patches for projects you don't maintain.
I hope that some information can be picked up in constructive ways also from my patch reviews.

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  8:06 [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report Ricardo Ribalda
  2025-01-29  8:36 ` Markus Elfring
@ 2025-01-29 17:38 ` Easwar Hariharan
  2025-06-10 13:09   ` Ricardo Ribalda
  1 sibling, 1 reply; 11+ messages in thread
From: Easwar Hariharan @ 2025-01-29 17:38 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Julia Lawall, Nicolas Palix, Andrew Morton, eahariha, cocci,
	linux-kernel

On 1/29/2025 12:06 AM, Ricardo Ribalda wrote:
> When running cocci in report mode, eg:
> $make coccicheck M="$dir" MODE=report
> 
> It returns this error:
> virtual rule report not supported
> coccicheck failed
> make: *** [Makefile:251: __sub-make] Error 2
> 
> Create a dummy rule to avoid this error and run the other cocci scripts.
> 
> Fixes: 551dbd1ec7ff ("coccinelle: misc: add secs_to_jiffies script")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> index 8bbb2884ea5d..2d85dca16418 100644
> --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> @@ -10,6 +10,7 @@
>  //
>  
>  virtual patch
> +virtual report
>  
>  @depends on patch@ constant C; @@
>  
> @@ -20,3 +21,8 @@ virtual patch
>  
>  - msecs_to_jiffies(C * MSEC_PER_SEC)
>  + secs_to_jiffies(C)
> +
> +// Dummy rule for report mode that would otherwise be empty and make spatch
> +// fail ("No rules apply.")
> +@script:python depends on report@
> +@@
> 

Sorry about that, and thanks for the patch!

FWIW,

Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29  9:51       ` Victor Gambier
  2025-01-29  9:56         ` Markus Elfring
@ 2025-01-31 10:05         ` Markus Elfring
  1 sibling, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2025-01-31 10:05 UTC (permalink / raw)
  To: Andrew Morton, Julia Lawall, Easwar Hariharan, Ricardo Ribalda,
	Victor Gambier, cocci
  Cc: LKML, kernel-janitors, Nicolas Palix

> Either provide a fully working example or stop nitpicking useful patches for projects you don't maintain.

Would you like to support any of my contributions a bit more?
[PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too
https://lore.kernel.org/cocci/e06cb7f5-7aa3-464c-a8a1-2c7b9b6a29eb@web.de/
https://sympa.inria.fr/sympa/arc/cocci/2025-01/msg00122.html
https://lkml.org/lkml/2025/1/30/307

Regards,
Markus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-01-29 17:38 ` [PATCH] " Easwar Hariharan
@ 2025-06-10 13:09   ` Ricardo Ribalda
  2025-06-10 17:35     ` Easwar Hariharan
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Ribalda @ 2025-06-10 13:09 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: Julia Lawall, Nicolas Palix, Andrew Morton, cocci, linux-kernel

Hi

On Wed, 29 Jan 2025 at 18:38, Easwar Hariharan
<eahariha@linux.microsoft.com> wrote:
>
> On 1/29/2025 12:06 AM, Ricardo Ribalda wrote:
> > When running cocci in report mode, eg:
> > $make coccicheck M="$dir" MODE=report
> >
> > It returns this error:
> > virtual rule report not supported
> > coccicheck failed
> > make: *** [Makefile:251: __sub-make] Error 2
> >
> > Create a dummy rule to avoid this error and run the other cocci scripts.
> >
> > Fixes: 551dbd1ec7ff ("coccinelle: misc: add secs_to_jiffies script")
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> >  scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> > index 8bbb2884ea5d..2d85dca16418 100644
> > --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
> > +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> > @@ -10,6 +10,7 @@
> >  //
> >
> >  virtual patch
> > +virtual report
> >
> >  @depends on patch@ constant C; @@
> >
> > @@ -20,3 +21,8 @@ virtual patch
> >
> >  - msecs_to_jiffies(C * MSEC_PER_SEC)
> >  + secs_to_jiffies(C)
> > +
> > +// Dummy rule for report mode that would otherwise be empty and make spatch
> > +// fail ("No rules apply.")
> > +@script:python depends on report@
> > +@@
> >
>
> Sorry about that, and thanks for the patch!
>
> FWIW,
>
> Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>

I just checked on 6.16rc1 and it is still failing.

Could we land this while Mark's series is under review?

Thanks!


-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-06-10 13:09   ` Ricardo Ribalda
@ 2025-06-10 17:35     ` Easwar Hariharan
  2025-06-11  7:59       ` Ricardo Ribalda
  0 siblings, 1 reply; 11+ messages in thread
From: Easwar Hariharan @ 2025-06-10 17:35 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: eahariha, Julia Lawall, Nicolas Palix, Andrew Morton, cocci,
	linux-kernel

On 6/10/2025 6:09 AM, Ricardo Ribalda wrote:
> Hi
> 
> On Wed, 29 Jan 2025 at 18:38, Easwar Hariharan
> <eahariha@linux.microsoft.com> wrote:
>>
>> On 1/29/2025 12:06 AM, Ricardo Ribalda wrote:
>>> When running cocci in report mode, eg:
>>> $make coccicheck M="$dir" MODE=report
>>>
>>> It returns this error:
>>> virtual rule report not supported
>>> coccicheck failed
>>> make: *** [Makefile:251: __sub-make] Error 2
>>>
>>> Create a dummy rule to avoid this error and run the other cocci scripts.
>>>
>>> Fixes: 551dbd1ec7ff ("coccinelle: misc: add secs_to_jiffies script")
>>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
>>> ---
>>>  scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> index 8bbb2884ea5d..2d85dca16418 100644
>>> --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
>>> @@ -10,6 +10,7 @@
>>>  //
>>>
>>>  virtual patch
>>> +virtual report
>>>
>>>  @depends on patch@ constant C; @@
>>>
>>> @@ -20,3 +21,8 @@ virtual patch
>>>
>>>  - msecs_to_jiffies(C * MSEC_PER_SEC)
>>>  + secs_to_jiffies(C)
>>> +
>>> +// Dummy rule for report mode that would otherwise be empty and make spatch
>>> +// fail ("No rules apply.")
>>> +@script:python depends on report@
>>> +@@
>>>
>>
>> Sorry about that, and thanks for the patch!
>>
>> FWIW,
>>
>> Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> 
> I just checked on 6.16rc1 and it is still failing.
> 
> Could we land this while Mark's series is under review?
> 
> Thanks!
> 

Can you provide a pointer to Mark's series? I actually just implemented a proper report and context mode
which I'm glad to send out.

Thanks,
Easwar (he/him)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report
  2025-06-10 17:35     ` Easwar Hariharan
@ 2025-06-11  7:59       ` Ricardo Ribalda
  0 siblings, 0 replies; 11+ messages in thread
From: Ricardo Ribalda @ 2025-06-11  7:59 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: Julia Lawall, Nicolas Palix, Andrew Morton, cocci, linux-kernel

On Tue, 10 Jun 2025 at 19:35, Easwar Hariharan
<eahariha@linux.microsoft.com> wrote:
>
> On 6/10/2025 6:09 AM, Ricardo Ribalda wrote:
> > Hi
> >
> > On Wed, 29 Jan 2025 at 18:38, Easwar Hariharan
> > <eahariha@linux.microsoft.com> wrote:
> >>
> >> On 1/29/2025 12:06 AM, Ricardo Ribalda wrote:
> >>> When running cocci in report mode, eg:
> >>> $make coccicheck M="$dir" MODE=report
> >>>
> >>> It returns this error:
> >>> virtual rule report not supported
> >>> coccicheck failed
> >>> make: *** [Makefile:251: __sub-make] Error 2
> >>>
> >>> Create a dummy rule to avoid this error and run the other cocci scripts.
> >>>
> >>> Fixes: 551dbd1ec7ff ("coccinelle: misc: add secs_to_jiffies script")
> >>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> >>> ---
> >>>  scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++
> >>>  1 file changed, 6 insertions(+)
> >>>
> >>> diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> >>> index 8bbb2884ea5d..2d85dca16418 100644
> >>> --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci
> >>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci
> >>> @@ -10,6 +10,7 @@
> >>>  //
> >>>
> >>>  virtual patch
> >>> +virtual report
> >>>
> >>>  @depends on patch@ constant C; @@
> >>>
> >>> @@ -20,3 +21,8 @@ virtual patch
> >>>
> >>>  - msecs_to_jiffies(C * MSEC_PER_SEC)
> >>>  + secs_to_jiffies(C)
> >>> +
> >>> +// Dummy rule for report mode that would otherwise be empty and make spatch
> >>> +// fail ("No rules apply.")
> >>> +@script:python depends on report@
> >>> +@@
> >>>
> >>
> >> Sorry about that, and thanks for the patch!
> >>
> >> FWIW,
> >>
> >> Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
> >
> > I just checked on 6.16rc1 and it is still failing.
> >
> > Could we land this while Mark's series is under review?
> >
> > Thanks!
> >
>
> Can you provide a pointer to Mark's series? I actually just implemented a proper report and context mode
> which I'm glad to send out.

My bad, it was your series:
https://lore.kernel.org/cocci/e06cb7f5-7aa3-464c-a8a1-2c7b9b6a29eb@web.de/



>
> Thanks,
> Easwar (he/him)



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-06-11  7:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-29  8:06 [PATCH] coccinelle: misc: secs_to_jiffies script: Create dummy report Ricardo Ribalda
2025-01-29  8:36 ` Markus Elfring
2025-01-29  8:40   ` Ricardo Ribalda
2025-01-29  8:46     ` Markus Elfring
2025-01-29  9:51       ` Victor Gambier
2025-01-29  9:56         ` Markus Elfring
2025-01-31 10:05         ` Markus Elfring
2025-01-29 17:38 ` [PATCH] " Easwar Hariharan
2025-06-10 13:09   ` Ricardo Ribalda
2025-06-10 17:35     ` Easwar Hariharan
2025-06-11  7:59       ` Ricardo Ribalda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome