scripts/coccinelle/misc/secs_to_jiffies.cocci | 6 ++++++ 1 file changed, 6 insertions(+)
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>
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>
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
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)
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
> 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
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
>>> 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
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
> 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
>> 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
© 2016 - 2026 Red Hat, Inc.