All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: fix over-zealous use of "const"
@ 2016-04-21 19:53 Kees Cook
  2016-04-21 22:17 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kees Cook @ 2016-04-21 19:53 UTC (permalink / raw)
  To: James Morris
  Cc: Andy Shevchenko, Mimi Zohar, Joe Perches, Andrew Morton,
	Serge E. Hallyn, Jonathan Corbet, Kalle Valo,
	Mauro Carvalho Chehab, Guenter Roeck, Jiri Slaby, Paul Moore,
	Stephen Smalley, Casey Schaufler, Andreas Gruenbacher,
	Rasmus Villemoes, Ulf Hansson, Vitaly Kuznetsov,
	linux-security-module, LKML, linux-doc

When I was fixing up const recommendations from checkpatch.pl, I went
overboard. This fixes the warning (during a W=1 build):

include/linux/fs.h:2627:74: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
static inline const char * const kernel_read_file_id_str(enum kernel_read_file_id id)

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This is for linux-security next
---
 include/linux/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 518716b4834e..82f9a2db3b1a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2610,7 +2610,7 @@ static const char * const kernel_read_file_str[] = {
 	__kernel_read_file_id(__fid_stringify)
 };
 
-static inline const char * const kernel_read_file_id_str(enum kernel_read_file_id id)
+static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id)
 {
 	if (id < 0 || id >= READING_MAX_ID)
 		return kernel_read_file_str[READING_UNKNOWN];
-- 
2.6.3


-- 
Kees Cook
Chrome OS & Brillo Security

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

* Re: [PATCH] fs: fix over-zealous use of "const"
  2016-04-21 19:53 [PATCH] fs: fix over-zealous use of "const" Kees Cook
@ 2016-04-21 22:17 ` Andy Shevchenko
  2016-04-25  9:03 ` Andy Shevchenko
  2016-04-27  7:07 ` James Morris
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-04-21 22:17 UTC (permalink / raw)
  To: Kees Cook
  Cc: James Morris, Andy Shevchenko, Mimi Zohar, Joe Perches,
	Andrew Morton, Serge E. Hallyn, Jonathan Corbet, Kalle Valo,
	Mauro Carvalho Chehab, Guenter Roeck, Jiri Slaby, Paul Moore,
	Stephen Smalley, Casey Schaufler, Andreas Gruenbacher,
	Rasmus Villemoes, Ulf Hansson, Vitaly Kuznetsov,
	linux-security-module, LKML, linux-doc

On Thu, Apr 21, 2016 at 10:53 PM, Kees Cook <keescook@chromium.org> wrote:
> When I was fixing up const recommendations from checkpatch.pl, I went
> overboard. This fixes the warning (during a W=1 build):
>
> include/linux/fs.h:2627:74: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
> static inline const char * const kernel_read_file_id_str(enum kernel_read_file_id id)
>
> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Will test next week if someone don't do that before.
Thanks.

> ---
> This is for linux-security next
> ---
>  include/linux/fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 518716b4834e..82f9a2db3b1a 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2610,7 +2610,7 @@ static const char * const kernel_read_file_str[] = {
>         __kernel_read_file_id(__fid_stringify)
>  };
>
> -static inline const char * const kernel_read_file_id_str(enum kernel_read_file_id id)
> +static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id)
>  {
>         if (id < 0 || id >= READING_MAX_ID)
>                 return kernel_read_file_str[READING_UNKNOWN];
> --
> 2.6.3
>
>
> --
> Kees Cook
> Chrome OS & Brillo Security



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] fs: fix over-zealous use of "const"
  2016-04-21 19:53 [PATCH] fs: fix over-zealous use of "const" Kees Cook
  2016-04-21 22:17 ` Andy Shevchenko
@ 2016-04-25  9:03 ` Andy Shevchenko
  2016-04-27  7:07 ` James Morris
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-04-25  9:03 UTC (permalink / raw)
  To: Kees Cook, James Morris
  Cc: Mimi Zohar, Joe Perches, Andrew Morton, Serge E. Hallyn,
	Jonathan Corbet, Kalle Valo, Mauro Carvalho Chehab,
	Guenter Roeck, Jiri Slaby, Paul Moore, Stephen Smalley,
	Casey Schaufler, Andreas Gruenbacher, Rasmus Villemoes,
	Ulf Hansson, Vitaly Kuznetsov, linux-security-module, LKML,
	linux-doc

On Thu, 2016-04-21 at 12:53 -0700, Kees Cook wrote:
> When I was fixing up const recommendations from checkpatch.pl, I went
> overboard. This fixes the warning (during a W=1 build):
> 
> include/linux/fs.h:2627:74: warning: type qualifiers ignored on
> function return type [-Wignored-qualifiers]
> static inline const char * const kernel_read_file_id_str(enum
> kernel_read_file_id id)
> 
> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This is for linux-security next
> ---
>  include/linux/fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 518716b4834e..82f9a2db3b1a 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2610,7 +2610,7 @@ static const char * const kernel_read_file_str[]
> = {
>  	__kernel_read_file_id(__fid_stringify)
>  };
>  
> -static inline const char * const kernel_read_file_id_str(enum
> kernel_read_file_id id)
> +static inline const char *kernel_read_file_id_str(enum
> kernel_read_file_id id)
>  {
>  	if (id < 0 || id >= READING_MAX_ID)
>  		return kernel_read_file_str[READING_UNKNOWN];
> -- 
> 2.6.3
> 
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH] fs: fix over-zealous use of "const"
  2016-04-21 19:53 [PATCH] fs: fix over-zealous use of "const" Kees Cook
  2016-04-21 22:17 ` Andy Shevchenko
  2016-04-25  9:03 ` Andy Shevchenko
@ 2016-04-27  7:07 ` James Morris
  2 siblings, 0 replies; 4+ messages in thread
From: James Morris @ 2016-04-27  7:07 UTC (permalink / raw)
  To: Kees Cook
  Cc: Andy Shevchenko, Mimi Zohar, Joe Perches, Andrew Morton,
	Serge E. Hallyn, Jonathan Corbet, Kalle Valo,
	Mauro Carvalho Chehab, Guenter Roeck, Jiri Slaby, Paul Moore,
	Stephen Smalley, Casey Schaufler, Andreas Gruenbacher,
	Rasmus Villemoes, Ulf Hansson, Vitaly Kuznetsov,
	linux-security-module, LKML, linux-doc

On Thu, 21 Apr 2016, Kees Cook wrote:

> When I was fixing up const recommendations from checkpatch.pl, I went
> overboard. This fixes the warning (during a W=1 build):
> 
> include/linux/fs.h:2627:74: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
> static inline const char * const kernel_read_file_id_str(enum kernel_read_file_id id)
> 
> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This is for linux-security next
> ---

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next


-- 
James Morris
<jmorris@namei.org>

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

end of thread, other threads:[~2016-04-27  7:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21 19:53 [PATCH] fs: fix over-zealous use of "const" Kees Cook
2016-04-21 22:17 ` Andy Shevchenko
2016-04-25  9:03 ` Andy Shevchenko
2016-04-27  7:07 ` James Morris

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.