All of lore.kernel.org
 help / color / mirror / Atom feed
* understanding metavariable
@ 2022-10-28 13:57 Deepak R Varma
  2022-10-28 14:26 ` Saurabh Singh Sengar
  0 siblings, 1 reply; 6+ messages in thread
From: Deepak R Varma @ 2022-10-28 13:57 UTC (permalink / raw)
  To: outreachy

Hello,
I am seeing a few warnings reported by coccicheck where it is suggested to use a
metavariable. See this example warning:

warning: line 223: should nonseekable_open be a metavariable?

I tried to understand about metavariable and how to address this coccicheck
warning, but did not fully conclude on my next steps.

Could you provide some details on this concept of metavariables please?



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

* Re: understanding metavariable
  2022-10-28 13:57 understanding metavariable Deepak R Varma
@ 2022-10-28 14:26 ` Saurabh Singh Sengar
  2022-10-28 15:05   ` Deepak R Varma
  2022-10-28 16:52   ` Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Saurabh Singh Sengar @ 2022-10-28 14:26 UTC (permalink / raw)
  To: Deepak R Varma; +Cc: outreachy

On Fri, Oct 28, 2022 at 07:27:12PM +0530, Deepak R Varma wrote:
> Hello,
> I am seeing a few warnings reported by coccicheck where it is suggested to use a
> metavariable. See this example warning:
> 
> warning: line 223: should nonseekable_open be a metavariable?

Can you share full more log along with the command you are trying to run.
Also, please let me know the kernel version you are trying this on.

- Saurabh

> 
> I tried to understand about metavariable and how to address this coccicheck
> warning, but did not fully conclude on my next steps.
> 
> Could you provide some details on this concept of metavariables please?
> 
> 

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

* Re: understanding metavariable
  2022-10-28 14:26 ` Saurabh Singh Sengar
@ 2022-10-28 15:05   ` Deepak R Varma
  2022-10-28 15:21     ` Saurabh Singh Sengar
  2022-10-28 16:52   ` Julia Lawall
  1 sibling, 1 reply; 6+ messages in thread
From: Deepak R Varma @ 2022-10-28 15:05 UTC (permalink / raw)
  To: Saurabh Singh Sengar; +Cc: outreachy

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On Fri, Oct 28, 2022 at 07:26:16AM -0700, Saurabh Sengar wrote:
> On Fri, Oct 28, 2022 at 07:27:12PM +0530, Deepak R Varma wrote:
> > Hello,
> > I am seeing a few warnings reported by coccicheck where it is suggested to use a
> > metavariable. See this example warning:
> >
> > warning: line 223: should nonseekable_open be a metavariable?
>
> Can you share full more log along with the command you are trying to run.
> Also, please let me know the kernel version you are trying this on.

Hello Saurabh,
My Kernel version is: 6.1.0-rc1-DVK

I am using following coccicheck command to list the warnings:
drv@ubunlion:~/git/kernels/staging$ make coccicheck M=drivers/staging/ | grep -i warning

A snip of the log is attached with this email for your quick reference. Let me
know if you need to know anything further.

Thank you,
./drv

>
> - Saurabh
>
> >
> > I tried to understand about metavariable and how to address this coccicheck
> > warning, but did not fully conclude on my next steps.
> >
> > Could you provide some details on this concept of metavariables please?
> >
> >
>

[-- Attachment #2: cocci_warn.log --]
[-- Type: text/plain, Size: 831 bytes --]

drv@ubunlion:~/git/kernels/staging$ make coccicheck M=drivers/staging/ -j4
/home/drv/.opam/default/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/stream_open.cocci --patch . --dir drivers/staging -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/compiler-version.h --include ./include/linux/kconfig.h --jobs 4 --chunksize 1
warning: line 134: should no_llseek be a metavariable?
warning: line 141: should noop_llseek be a metavariable?
warning: line 223: should nonseekable_open be a metavariable?
warning: line 290: should nonseekable_open be a metavariable?
warning: line 338: should nonseekable_open be a metavariable?
10 files match


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

* Re: understanding metavariable
  2022-10-28 15:05   ` Deepak R Varma
@ 2022-10-28 15:21     ` Saurabh Singh Sengar
  0 siblings, 0 replies; 6+ messages in thread
From: Saurabh Singh Sengar @ 2022-10-28 15:21 UTC (permalink / raw)
  To: Deepak R Varma; +Cc: outreachy

On Fri, Oct 28, 2022 at 08:35:17PM +0530, Deepak R Varma wrote:
> On Fri, Oct 28, 2022 at 07:26:16AM -0700, Saurabh Sengar wrote:
> > On Fri, Oct 28, 2022 at 07:27:12PM +0530, Deepak R Varma wrote:
> > > Hello,
> > > I am seeing a few warnings reported by coccicheck where it is suggested to use a
> > > metavariable. See this example warning:
> > >
> > > warning: line 223: should nonseekable_open be a metavariable?
> >
> > Can you share full more log along with the command you are trying to run.
> > Also, please let me know the kernel version you are trying this on.
> 
> Hello Saurabh,
> My Kernel version is: 6.1.0-rc1-DVK
> 
> I am using following coccicheck command to list the warnings:
> drv@ubunlion:~/git/kernels/staging$ make coccicheck M=drivers/staging/ | grep -i warning
> 
This appear to be a warning in script itself, not the WARNING from the report. I tried applying
this patch and it appear to fix the problem.
https://www.spinics.net/lists/kernel/msg4306085.html . Julia can add more about this issue or
the patch status.

I can suggest you a different command which will avoid showing you any scripts warning. You can
give it a try :
make coccicheck DEBUG_FILE=debug.txt M=drivers/staging/

Make sure you don't have debug.txt in you local folder where you run this cmd.

- Saurabh

> A snip of the log is attached with this email for your quick reference. Let me
> know if you need to know anything further.
> 
> Thank you,
> ./drv
> 
> >
> > - Saurabh
> >
> > >
> > > I tried to understand about metavariable and how to address this coccicheck
> > > warning, but did not fully conclude on my next steps.
> > >
> > > Could you provide some details on this concept of metavariables please?
> > >
> > >
> >

> drv@ubunlion:~/git/kernels/staging$ make coccicheck M=drivers/staging/ -j4
> /home/drv/.opam/default/bin/spatch -D report --no-show-diff --very-quiet --cocci-file ./scripts/coccinelle/api/stream_open.cocci --patch . --dir drivers/staging -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi --include ./include/linux/compiler-version.h --include ./include/linux/kconfig.h --jobs 4 --chunksize 1
> warning: line 134: should no_llseek be a metavariable?
> warning: line 141: should noop_llseek be a metavariable?
> warning: line 223: should nonseekable_open be a metavariable?
> warning: line 290: should nonseekable_open be a metavariable?
> warning: line 338: should nonseekable_open be a metavariable?
> 10 files match
> 


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

* Re: understanding metavariable
  2022-10-28 14:26 ` Saurabh Singh Sengar
  2022-10-28 15:05   ` Deepak R Varma
@ 2022-10-28 16:52   ` Julia Lawall
  2022-10-28 17:23     ` Deepak R Varma
  1 sibling, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2022-10-28 16:52 UTC (permalink / raw)
  To: Saurabh Singh Sengar; +Cc: Deepak R Varma, outreachy



On Fri, 28 Oct 2022, Saurabh Singh Sengar wrote:

> On Fri, Oct 28, 2022 at 07:27:12PM +0530, Deepak R Varma wrote:
> > Hello,
> > I am seeing a few warnings reported by coccicheck where it is suggested to use a
> > metavariable. See this example warning:
> >
> > warning: line 223: should nonseekable_open be a metavariable?
>
> Can you share full more log along with the command you are trying to run.
> Also, please let me know the kernel version you are trying this on.

The semantic patch could be improved by adding

symbol nonseekable_open;

in the metavariable list, to make clear that it is intended to match
exactly.  But it is probably better to focus on finding things to change
in the Linux kernel .c files.

julia

>
> - Saurabh
>
> >
> > I tried to understand about metavariable and how to address this coccicheck
> > warning, but did not fully conclude on my next steps.
> >
> > Could you provide some details on this concept of metavariables please?
> >
> >
>
>

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

* Re: understanding metavariable
  2022-10-28 16:52   ` Julia Lawall
@ 2022-10-28 17:23     ` Deepak R Varma
  0 siblings, 0 replies; 6+ messages in thread
From: Deepak R Varma @ 2022-10-28 17:23 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Saurabh Singh Sengar, outreachy

On Fri, Oct 28, 2022 at 06:52:54PM +0200, Julia Lawall wrote:
>
>
> On Fri, 28 Oct 2022, Saurabh Singh Sengar wrote:
>
> > On Fri, Oct 28, 2022 at 07:27:12PM +0530, Deepak R Varma wrote:
> > > Hello,
> > > I am seeing a few warnings reported by coccicheck where it is suggested to use a
> > > metavariable. See this example warning:
> > >
> > > warning: line 223: should nonseekable_open be a metavariable?
> >
> > Can you share full more log along with the command you are trying to run.
> > Also, please let me know the kernel version you are trying this on.
>
> The semantic patch could be improved by adding
>
> symbol nonseekable_open;
>
> in the metavariable list, to make clear that it is intended to match
> exactly.  But it is probably better to focus on finding things to change
> in the Linux kernel .c files.

Thank you Julia and Saurabh. I was not aware of the source of these warnings. I will
continue to focus on looking at items from the Kernel .c files as suggested.

Thank you,
./drv

>
> julia
>
> >
> > - Saurabh
> >
> > >
> > > I tried to understand about metavariable and how to address this coccicheck
> > > warning, but did not fully conclude on my next steps.
> > >
> > > Could you provide some details on this concept of metavariables please?
> > >
> > >
> >
> >
>



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

end of thread, other threads:[~2022-10-28 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 13:57 understanding metavariable Deepak R Varma
2022-10-28 14:26 ` Saurabh Singh Sengar
2022-10-28 15:05   ` Deepak R Varma
2022-10-28 15:21     ` Saurabh Singh Sengar
2022-10-28 16:52   ` Julia Lawall
2022-10-28 17:23     ` Deepak R Varma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.