All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with coccinelle.
@ 2017-02-28  2:43 Varsha Rao
  2017-02-28  2:50 ` Varsha Rao
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Varsha Rao @ 2017-02-28  2:43 UTC (permalink / raw)
  To: outreachy-kernel


[-- Attachment #1.1: Type: text/plain, Size: 818 bytes --]


Hello,

I am getting errors when I run the following command

spatch --sp-file coccinelle/ret.cocci --no-includes --dir 
git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out

and the error which i got is:

init_defs_builtins: /usr/lib64/coccinelle/standard.h
Fatal error: exception Failure("unexpected code before the first rule: [0; 
(68, (\"\", [0], [0]))]\n")

I have installed coccinelle successfully.

Packages which were installed,
coccinelle                   1.0.5-2.fc25 
 ocaml                        4.02.3-3.fc25 
 ocaml-compiler-libs     4.02.3-3.fc25  
 ocaml-findlib               1.6.2-1.fc25      
 ocaml-pcre                 7.1.5-3.fc24         
 ocaml-runtime            4.02.3-3.fc25       

I am using fedora 25 and kernel release is 4.9.11-200.fc25.x86_64.

Thanks,
Varsha

[-- Attachment #1.2: Type: text/html, Size: 1047 bytes --]

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

* Re: Problem with coccinelle.
  2017-02-28  2:43 Problem with coccinelle Varsha Rao
@ 2017-02-28  2:50 ` Varsha Rao
  2017-02-28  6:48   ` [Outreachy kernel] " Julia Lawall
  2017-02-28  6:51 ` [Outreachy kernel] " Julia Lawall
  2017-02-28 13:53 ` Varsha Rao
  2 siblings, 1 reply; 16+ messages in thread
From: Varsha Rao @ 2017-02-28  2:50 UTC (permalink / raw)
  To: outreachy-kernel


[-- Attachment #1.1: Type: text/plain, Size: 191 bytes --]

Hello,

Within /usr/lib64/coccinelle/
I have the following files:
ocaml  spatch  spatch.opt  standard.h  standard.iso

So did I follow any wrong step or is something missing?

Thanks,
Varsha

[-- Attachment #1.2: Type: text/html, Size: 246 bytes --]

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28  2:50 ` Varsha Rao
@ 2017-02-28  6:48   ` Julia Lawall
  2017-02-28 10:38     ` Varsha Rao
  0 siblings, 1 reply; 16+ messages in thread
From: Julia Lawall @ 2017-02-28  6:48 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

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



On Mon, 27 Feb 2017, Varsha Rao wrote:

> Hello,
>
> Within /usr/lib64/coccinelle/
> I have the following files:
> ocaml  spatch  spatch.opt  standard.h  standard.iso
>
> So did I follow any wrong step or is something missing?

This seems likely fine.  How did you get to this situation?  Did you
install it from your package manager or did you compile it on your
machine.  When you run spatch, does it work?

julia

>
> Thanks,
> Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/c2f9d539-fe98-4541-b86c-
> f71555d44020%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] Problem with coccinelle.
  2017-02-28  2:43 Problem with coccinelle Varsha Rao
  2017-02-28  2:50 ` Varsha Rao
@ 2017-02-28  6:51 ` Julia Lawall
  2017-02-28 10:41   ` Varsha Rao
  2017-02-28 13:53 ` Varsha Rao
  2 siblings, 1 reply; 16+ messages in thread
From: Julia Lawall @ 2017-02-28  6:51 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

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



On Mon, 27 Feb 2017, Varsha Rao wrote:

>
> Hello,
>
> I am getting errors when I run the following command
>
> spatch --sp-file coccinelle/ret.cocci --no-includes --dir
> git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>
> and the error which i got is:
>
> init_defs_builtins: /usr/lib64/coccinelle/standard.h
> Fatal error: exception Failure("unexpected code before the first rule: [0;
> (68, (\"\", [0], [0]))]\n")

Could you send your file ret.cocci?  Maybe try running Coccinelle from the
directory in which ret.cocci is found.  Actually, if you are running it on
only a single file, then you don't need the --dir option.  That is to
indicate that you are using a complete directory,

julia


> I have installed coccinelle successfully.
>
> Packages which were installed,
> coccinelle                   1.0.5-2.fc25
>  ocaml                        4.02.3-3.fc25
>  ocaml-compiler-libs     4.02.3-3.fc25 
>  ocaml-findlib               1.6.2-1.fc25     
>  ocaml-pcre                 7.1.5-3.fc24        
>  ocaml-runtime            4.02.3-3.fc25      
>
> I am using fedora 25 and kernel release is 4.9.11-200.fc25.x86_64.
>
> Thanks,
> Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/97a8b35a-3899-436b-8455-
> 6fdd5d3a6ccd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28  6:48   ` [Outreachy kernel] " Julia Lawall
@ 2017-02-28 10:38     ` Varsha Rao
  2017-02-28 12:28       ` Vaishali Thakkar
  0 siblings, 1 reply; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 10:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: rvarsha016


[-- Attachment #1.1: Type: text/plain, Size: 893 bytes --]



> This seems likely fine.  How did you get to this situation?  Did you 
> install it from your package manager or did you compile it on your 
> machine.  When you run spatch, does it work? 
>
>    I have installed using package manager.
   when I run spatch, it gives following errors:
        
   spatch --sp-file ret.cocci --no-includes 
~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out

  init_defs_builtins: /usr/lib64/coccinelle/standard.h
  minus: parse error: 
  File "ret.cocci", line 10, column 0, charpos = 80
  around = '',
  whole content = 

 [varsha@varsha coccinelle]$ spatch --sp-file ret.cocci --no-includes 
~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
 init_defs_builtins: /usr/lib64/coccinelle/standard.h 
 HANDLING: 
/home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c

 Thanks,
 Varsha


[-- Attachment #1.2: Type: text/html, Size: 1167 bytes --]

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

* Re: [Outreachy kernel] Problem with coccinelle.
  2017-02-28  6:51 ` [Outreachy kernel] " Julia Lawall
@ 2017-02-28 10:41   ` Varsha Rao
  0 siblings, 0 replies; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 10:41 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: rvarsha016


[-- Attachment #1.1: Type: text/plain, Size: 105 bytes --]

Contents of ret.cocci

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;


[-- Attachment #1.2: Type: text/html, Size: 166 bytes --]

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 10:38     ` Varsha Rao
@ 2017-02-28 12:28       ` Vaishali Thakkar
  2017-02-28 13:14         ` Julia Lawall
  2017-02-28 13:37         ` Varsha Rao
  0 siblings, 2 replies; 16+ messages in thread
From: Vaishali Thakkar @ 2017-02-28 12:28 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

On Tue, Feb 28, 2017 at 4:08 PM, Varsha Rao <rvarsha016@gmail.com> wrote:
>
>> This seems likely fine.  How did you get to this situation?  Did you
>> install it from your package manager or did you compile it on your
>> machine.  When you run spatch, does it work?
>>
>    I have installed using package manager.
>    when I run spatch, it gives following errors:
>
>    spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>
>   init_defs_builtins: /usr/lib64/coccinelle/standard.h
>   minus: parse error:
>   File "ret.cocci", line 10, column 0, charpos = 80
>   around = '',
>   whole content =

The file[ret.cocci] sent by you works perfectly fine for me without any parsing
error. Are you sure there is nothing else in the same file [ret.cocci]?

Parsing error is shown at the line 10 and file has 9 lines. Also, in your
first mail you seemed to have something else as an error. [Exception
failure]

>  [varsha@varsha coccinelle]$ spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>  init_defs_builtins: /usr/lib64/coccinelle/standard.h
>  HANDLING:
> /home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c

If you have installed coccinelle from package manager then what is under
coccinelle directory? Have you cloned coccinelle code and have tried to
install it manually as well?

>  Thanks,
>  Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/68311bc4-09a6-4baf-ab04-b0ce5916c4c9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Vaishali
http://vaishalithakkar.in/


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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 12:28       ` Vaishali Thakkar
@ 2017-02-28 13:14         ` Julia Lawall
  2017-02-28 13:37         ` Varsha Rao
  1 sibling, 0 replies; 16+ messages in thread
From: Julia Lawall @ 2017-02-28 13:14 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: Varsha Rao, outreachy-kernel



On Tue, 28 Feb 2017, Vaishali Thakkar wrote:

> On Tue, Feb 28, 2017 at 4:08 PM, Varsha Rao <rvarsha016@gmail.com> wrote:
> >
> >> This seems likely fine.  How did you get to this situation?  Did you
> >> install it from your package manager or did you compile it on your
> >> machine.  When you run spatch, does it work?
> >>
> >    I have installed using package manager.
> >    when I run spatch, it gives following errors:
> >
> >    spatch --sp-file ret.cocci --no-includes
> > ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
> >
> >   init_defs_builtins: /usr/lib64/coccinelle/standard.h
> >   minus: parse error:
> >   File "ret.cocci", line 10, column 0, charpos = 80
> >   around = '',
> >   whole content =
>
> The file[ret.cocci] sent by you works perfectly fine for me without any parsing
> error. Are you sure there is nothing else in the same file [ret.cocci]?
>
> Parsing error is shown at the line 10 and file has 9 lines. Also, in your
> first mail you seemed to have something else as an error. [Exception
> failure]

This is understandable.  If the parser is confused at the end of the file,
it will show an error past the last line in the file, at least is there is
a newline at the end of the last line.

julia

>
> >  [varsha@varsha coccinelle]$ spatch --sp-file ret.cocci --no-includes
> > ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
> >  init_defs_builtins: /usr/lib64/coccinelle/standard.h
> >  HANDLING:
> > /home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c
>
> If you have installed coccinelle from package manager then what is under
> coccinelle directory? Have you cloned coccinelle code and have tried to
> install it manually as well?
>
> >  Thanks,
> >  Varsha
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/outreachy-kernel/68311bc4-09a6-4baf-ab04-b0ce5916c4c9%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Vaishali
> http://vaishalithakkar.in/
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAK-LDbKHYUe_Hs79ie52FHtLFZG4rGb8kbds5EaQb2kMUEMqKA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 12:28       ` Vaishali Thakkar
  2017-02-28 13:14         ` Julia Lawall
@ 2017-02-28 13:37         ` Varsha Rao
  1 sibling, 0 replies; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 13:37 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: rvarsha016


[-- Attachment #1.1: Type: text/plain, Size: 1323 bytes --]



> > ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > 
> ret.out 
> > 
> >   init_defs_builtins: /usr/lib64/coccinelle/standard.h 
> >   minus: parse error: 
> >   File "ret.cocci", line 10, column 0, charpos = 80 
> >   around = '', 
> >   whole content = 
>
> The file[ret.cocci] sent by you works perfectly fine for me without any 
> parsing 
> error. Are you sure there is nothing else in the same file [ret.cocci]? 
>
   
    Yes, nothing is there.

>
> Parsing error is shown at the line 10 and file has 9 lines. Also, in your 
> first mail you seemed to have something else as an error. [Exception 
> failure] 
>
> >  [varsha@varsha coccinelle]$ spatch --sp-file ret.cocci --no-includes 
> > ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > 
> ret.out 
> >  init_defs_builtins: /usr/lib64/coccinelle/standard.h 
> >  HANDLING: 
> > 
> /home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c 
>
> If you have installed coccinelle from package manager then what is under 
> coccinelle directory? 

 
   Within /usr/lib64/coccinelle/
   I have the following files:
   ocaml  spatch  spatch.opt  standard.h  standard.iso

Have you cloned coccinelle code and have tried to 
> install it manually as well? 
>
>    No, I have not.      
  
   Thanks, 
    Varsha 

[-- Attachment #1.2: Type: text/html, Size: 1993 bytes --]

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

* Re: Problem with coccinelle.
  2017-02-28  2:43 Problem with coccinelle Varsha Rao
  2017-02-28  2:50 ` Varsha Rao
  2017-02-28  6:51 ` [Outreachy kernel] " Julia Lawall
@ 2017-02-28 13:53 ` Varsha Rao
  2017-02-28 13:56   ` [Outreachy kernel] " Julia Lawall
  2017-02-28 13:59   ` Vaishali Thakkar
  2 siblings, 2 replies; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 13:53 UTC (permalink / raw)
  To: outreachy-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1633 bytes --]

 Hello,

  I tried spatch command again with few other files and it ran 
successfully. (with the same ret.cocci file I sent)

  spatch --sp-file ret.cocci --no-includes 
~/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c > ret.out
  init_defs_builtins: /usr/lib64/coccinelle/standard.h
  HANDLING: 
/home/euri/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
  diff = 

   output of ret.out

   --- 
/home/varsha/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
+++ /tmp/cocci-output-3058-919028-ddk750_chip.c
@@ -397,13 +397,11 @@ unsigned int sm750_format_pll_reg(struct
      * register. On returning a 32 bit number, the value can be
      * applied to any PLL in the calling function.
      */
-    reg = PLL_CTRL_POWER |
+    return PLL_CTRL_POWER |
 #ifndef VALIDATION_CHIP
         ((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
 #endif
         ((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
         ((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
         ((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
-
-    return reg;
 }

   
   But nothing with dim2_sysfs.c file and even ret.out file is empty. But 
no errors this time.

  spatch --sp-file ret.cocci --no-includes 
~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
  init_defs_builtins: /usr/lib64/coccinelle/standard.h
  HANDLING: 
/home/euri/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c
   
  Does coccinelle need driver to be compiled as a module? As hdm_dim2 
driver is not but sm750fb driver is compiled as a module. Does coccinelle 
require executable file to work?

  Thanks,
  Varsha

[-- Attachment #1.2: Type: text/html, Size: 1890 bytes --]

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 13:53 ` Varsha Rao
@ 2017-02-28 13:56   ` Julia Lawall
  2017-02-28 14:17     ` Varsha Rao
  2017-02-28 13:59   ` Vaishali Thakkar
  1 sibling, 1 reply; 16+ messages in thread
From: Julia Lawall @ 2017-02-28 13:56 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

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



On Tue, 28 Feb 2017, Varsha Rao wrote:

>  Hello,
>
>   I tried spatch command again with few other files and it ran successfully.
> (with the same ret.cocci file I sent)
>
>   spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c > ret.out
>   init_defs_builtins: /usr/lib64/coccinelle/standard.h
>   HANDLING:
> /home/euri/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
>   diff =
>
>    output of ret.out
>
>    ---
> /home/varsha/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
> +++ /tmp/cocci-output-3058-919028-ddk750_chip.c
> @@ -397,13 +397,11 @@ unsigned int sm750_format_pll_reg(struct
>       * register. On returning a 32 bit number, the value can be
>       * applied to any PLL in the calling function.
>       */
> -    reg = PLL_CTRL_POWER |
> +    return PLL_CTRL_POWER |
>  #ifndef VALIDATION_CHIP
>          ((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
>  #endif
>          ((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
>          ((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
>          ((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
> -
> -    return reg;
>  }
>
>   
>    But nothing with dim2_sysfs.c file and even ret.out file is empty. But no
> errors this time.
>
>   spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>   init_defs_builtins: /usr/lib64/coccinelle/standard.h
>   HANDLING:
> /home/euri/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c
>   
>   Does coccinelle need driver to be compiled as a module? As hdm_dim2 driver
> is not but sm750fb driver is compiled as a module. Does coccinelle require
> executable file to work?

No, it just looks at the source code.  It doesn't care about modules, etc.

Could you try the original experiment again?  Maybe the problem is somehow
resolved.

julia



>
>   Thanks,
>   Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/465dc1ff-b520-4ad1-862f-
> 0fa268803f06%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 13:53 ` Varsha Rao
  2017-02-28 13:56   ` [Outreachy kernel] " Julia Lawall
@ 2017-02-28 13:59   ` Vaishali Thakkar
  1 sibling, 0 replies; 16+ messages in thread
From: Vaishali Thakkar @ 2017-02-28 13:59 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

On Tue, Feb 28, 2017 at 7:23 PM, Varsha Rao <rvarsha016@gmail.com> wrote:
>  Hello,
>
>   I tried spatch command again with few other files and it ran successfully.
> (with the same ret.cocci file I sent)
>
>   spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c > ret.out
>   init_defs_builtins: /usr/lib64/coccinelle/standard.h
>   HANDLING:
> /home/euri/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
>   diff =
>
>    output of ret.out
>
>    ---
> /home/varsha/git/kernels/staging/drivers/staging/sm750fb/ddk750_chip.c
> +++ /tmp/cocci-output-3058-919028-ddk750_chip.c
> @@ -397,13 +397,11 @@ unsigned int sm750_format_pll_reg(struct
>       * register. On returning a 32 bit number, the value can be
>       * applied to any PLL in the calling function.
>       */
> -    reg = PLL_CTRL_POWER |
> +    return PLL_CTRL_POWER |
>  #ifndef VALIDATION_CHIP
>          ((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
>  #endif
>          ((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
>          ((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
>          ((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
> -
> -    return reg;
>  }
>
>
>    But nothing with dim2_sysfs.c file and even ret.out file is empty. But no
> errors this time.

If there is no parsing error then problem with your coccinelle script seems to
be solved. The file ret.out can be empty if there is no such case
where coccinelle
can apply the rule.

>   spatch --sp-file ret.cocci --no-includes
> ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>   init_defs_builtins: /usr/lib64/coccinelle/standard.h
>   HANDLING:
> /home/euri/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c
>
>   Does coccinelle need driver to be compiled as a module? As hdm_dim2 driver
> is not but sm750fb driver is compiled as a module. Does coccinelle require
> executable file to work?
>
>   Thanks,
>   Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/465dc1ff-b520-4ad1-862f-0fa268803f06%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Vaishali
http://vaishalithakkar.in/


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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 13:56   ` [Outreachy kernel] " Julia Lawall
@ 2017-02-28 14:17     ` Varsha Rao
  2017-02-28 14:38       ` Varsha Rao
  2017-02-28 14:39       ` Julia Lawall
  0 siblings, 2 replies; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 14:17 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: rvarsha016


[-- Attachment #1.1: Type: text/plain, Size: 1036 bytes --]

    

> >   Does coccinelle need driver to be compiled as a module? As hdm_dim2 
> driver 
> > is not but sm750fb driver is compiled as a module. Does coccinelle 
> require 
> > executable file to work? 
>
> No, it just looks at the source code.  It doesn't care about modules, etc.

    
    Then it is strange, as I tried again with different drivers, few of 
them work and few others don't.
    
    Drivers compiled as module and got output : iio and sm750fb
    Drivers not compiled as module but still got output: lustre and greybus
    Drivers not compiled as module and no output: most (all drivers) and 
netlogic


> Could you try the original experiment again?  Maybe the problem is somehow 
> resolved. 
>
>     Same output.
    
   spatch --sp-file ret.cocci --no-includes  
~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out 
   init_defs_builtins: /usr/lib64/coccinelle/standard.h
   HANDLING: 
   
/home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c

   Thanks,
   Varsha

[-- Attachment #1.2: Type: text/html, Size: 1461 bytes --]

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 14:17     ` Varsha Rao
@ 2017-02-28 14:38       ` Varsha Rao
  2017-02-28 14:40         ` Julia Lawall
  2017-02-28 14:39       ` Julia Lawall
  1 sibling, 1 reply; 16+ messages in thread
From: Varsha Rao @ 2017-02-28 14:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: rvarsha016


[-- Attachment #1.1: Type: text/plain, Size: 429 bytes --]


    Hello,

    Thanks Julia and Vaishali for helping me. I understood the reason for 
blank output. 
    Since, the *file has already been updated with the coccinelle output 
patch and 
    as Vaishali said, so there is no case where coccinelle can be applied.
    Probably the example needs to be changed, as it may create confusion 
for newbies.

    Thanks,
    Varsha

    *File referred here is most/hdm-dim2/dim2_sysfs.c

[-- Attachment #1.2: Type: text/html, Size: 500 bytes --]

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 14:17     ` Varsha Rao
  2017-02-28 14:38       ` Varsha Rao
@ 2017-02-28 14:39       ` Julia Lawall
  1 sibling, 0 replies; 16+ messages in thread
From: Julia Lawall @ 2017-02-28 14:39 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

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



On Tue, 28 Feb 2017, Varsha Rao wrote:

>    
>       >   Does coccinelle need driver to be compiled as a module? As
>       hdm_dim2 driver
>       > is not but sm750fb driver is compiled as a module. Does
>       coccinelle require
>       > executable file to work?
>
>       No, it just looks at the source code.  It doesn't care about
>       modules, etc.
>
>    
>     Then it is strange, as I tried again with different drivers, few of them
> work and few others don't.
>    
>     Drivers compiled as module and got output : iio and sm750fb
>     Drivers not compiled as module but still got output: lustre and greybus
>     Drivers not compiled as module and no output: most (all drivers) and
> netlogic
>
>
>       Could you try the original experiment again?  Maybe the problem
>       is somehow
>       resolved.
>
>     Same output.
>    
>    spatch --sp-file ret.cocci --no-includes 
> ~/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c  > ret.out
>    init_defs_builtins: /usr/lib64/coccinelle/standard.h
>    HANDLING:
>   /home/varsha/git/kernels/staging/drivers/staging/most/hdm-dim2/dim2_sysfs.c

So there is no problem?

julia

>
>
>    Thanks,
>    Varsha
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/2c41d6b9-a3f8-4229-87ba-
> a31145c451c5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

* Re: [Outreachy kernel] Re: Problem with coccinelle.
  2017-02-28 14:38       ` Varsha Rao
@ 2017-02-28 14:40         ` Julia Lawall
  0 siblings, 0 replies; 16+ messages in thread
From: Julia Lawall @ 2017-02-28 14:40 UTC (permalink / raw)
  To: Varsha Rao; +Cc: outreachy-kernel

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

On Tue, 28 Feb 2017, Varsha Rao wrote:

>
>     Hello,
>
>     Thanks Julia and Vaishali for helping me. I understood the reason for
> blank output.
>     Since, the *file has already been updated with the coccinelle output
> patch and
>     as Vaishali said, so there is no case where coccinelle can be applied.
>     Probably the example needs to be changed, as it may create confusion for
> newbies.

Ah, ok, sorry aout that.  I was concerned about the parse error.

I will improve the example.

julia

>
>     Thanks,
>     Varsha
>
>     *File referred here is most/hdm-dim2/dim2_sysfs.c
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/dad01fb8-4b21-46ce-806f-
> 1235c8910474%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

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

end of thread, other threads:[~2017-02-28 14:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28  2:43 Problem with coccinelle Varsha Rao
2017-02-28  2:50 ` Varsha Rao
2017-02-28  6:48   ` [Outreachy kernel] " Julia Lawall
2017-02-28 10:38     ` Varsha Rao
2017-02-28 12:28       ` Vaishali Thakkar
2017-02-28 13:14         ` Julia Lawall
2017-02-28 13:37         ` Varsha Rao
2017-02-28  6:51 ` [Outreachy kernel] " Julia Lawall
2017-02-28 10:41   ` Varsha Rao
2017-02-28 13:53 ` Varsha Rao
2017-02-28 13:56   ` [Outreachy kernel] " Julia Lawall
2017-02-28 14:17     ` Varsha Rao
2017-02-28 14:38       ` Varsha Rao
2017-02-28 14:40         ` Julia Lawall
2017-02-28 14:39       ` Julia Lawall
2017-02-28 13:59   ` Vaishali Thakkar

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.