1. 17 Dec, 2018 1 commit
    • Guenter Roeck's avatar
      staging: speakup: Replace strncpy with memcpy · 16906e5a
      Guenter Roeck authored
      commit fd29edc7
      
       upstream.
      
      gcc 8.1.0 generates the following warnings.
      
      drivers/staging/speakup/kobjects.c: In function 'punc_store':
      drivers/staging/speakup/kobjects.c:522:2: warning:
      	'strncpy' output truncated before terminating nul
      	copying as many bytes from a string as its length
      drivers/staging/speakup/kobjects.c:504:6: note: length computed here
      
      drivers/staging/speakup/kobjects.c: In function 'synth_store':
      drivers/staging/speakup/kobjects.c:391:2: warning:
      	'strncpy' output truncated before terminating nul
      	copying as many bytes from a string as its length
      drivers/staging/speakup/kobjects.c:388:8: note: length computed here
      
      Using strncpy() is indeed less than perfect since the length of data to
      be copied has already been determined with strlen(). Replace strncpy()
      with memcpy() to address the warning and optimize the code a little.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16906e5a
  2. 23 Mar, 2017 1 commit
  3. 13 Mar, 2017 1 commit
  4. 09 Mar, 2017 5 commits
  5. 06 Mar, 2017 4 commits
  6. 10 Jan, 2017 1 commit
  7. 02 Oct, 2016 1 commit
    • Bhumika Goyal's avatar
      Staging: speakup: constify attribute_group structures · c4610f6e
      Bhumika Goyal authored
      
      
      Check for attribute_group structures that are only passed as a second
      argument to the functions sysfs_remove_group and sysfs_create_group. As
      these arguments are constant so, attribute_group structures having this
      property  can also be made constant.
      Done using coccinelle:
      
      @r1 disable optional_qualifier @
      identifier i;
      position p;
      @@
      static struct attribute_group i@p = {...};
      
      @ok1@
      identifier r1.i;
      position p;
      expression e1;
      @@
      (
      sysfs_remove_group(e1,&i@p)
      |
      sysfs_create_group(e1,&i@p)
      )
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      static
      +const
      struct attribute_group i={...};
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct attribute_group i;
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         7551	   1440	     16	   9007	   232f
      drivers/staging/speakup/kobjects.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         7671	   1312	     16	   8999	   2327
      drivers/staging/speakup/kobjects.o
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Acked-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4610f6e
  8. 22 Sep, 2016 1 commit
  9. 12 Sep, 2016 1 commit
  10. 05 Mar, 2016 1 commit
  11. 13 Sep, 2015 1 commit
  12. 15 Aug, 2015 1 commit
  13. 09 Mar, 2015 1 commit
  14. 18 Jan, 2015 1 commit
  15. 20 Oct, 2014 2 commits
  16. 20 Sep, 2014 1 commit
  17. 11 Sep, 2014 1 commit
  18. 23 May, 2014 1 commit
  19. 14 May, 2014 1 commit
  20. 18 Apr, 2014 1 commit
  21. 01 Apr, 2014 1 commit
    • Rusty Russell's avatar
      staging: fix up speakup kobject mode · 22c9bcad
      Rusty Russell authored
      
      
      It uses the unnecessary S_IFREG bit which broke when my
      stricter-checking-for-mode patch went in.
      
      Since we're fixing it anyway, the extra level of indirection is
      confusing for readers (ROOT_W == rw-r--r-- for example).
      
      Also, many of these are other-writable.  Is that really intended?
      
      I'll-queue-this-patch-up-in-a-bit-by: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      22c9bcad
  22. 19 Oct, 2013 1 commit
  23. 17 Sep, 2013 2 commits
  24. 22 May, 2013 1 commit
  25. 16 May, 2013 1 commit
  26. 01 May, 2013 1 commit
  27. 29 Mar, 2013 2 commits
  28. 17 Jan, 2013 1 commit
  29. 07 Jan, 2013 1 commit
  30. 27 Nov, 2011 1 commit