Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752754AbcDUWRl (ORCPT ); Thu, 21 Apr 2016 18:17:41 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:34872 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508AbcDUWRj (ORCPT ); Thu, 21 Apr 2016 18:17:39 -0400 MIME-Version: 1.0 In-Reply-To: <20160421195329.GA10362@www.outflux.net> References: <20160421195329.GA10362@www.outflux.net> Date: Fri, 22 Apr 2016 01:17:38 +0300 Message-ID: Subject: Re: [PATCH] fs: fix over-zealous use of "const" From: Andy Shevchenko 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@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1391 Lines: 45 On Thu, Apr 21, 2016 at 10:53 PM, 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 > Signed-off-by: Kees Cook 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