Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754131AbcDYJCD (ORCPT ); Mon, 25 Apr 2016 05:02:03 -0400 Received: from mga01.intel.com ([192.55.52.88]:54844 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753483AbcDYJCA (ORCPT ); Mon, 25 Apr 2016 05:02:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,532,1455004800"; d="scan'208";a="965847360" Message-ID: <1461574980.17131.0.camel@linux.intel.com> Subject: Re: [PATCH] fs: fix over-zealous use of "const" From: Andy Shevchenko 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@vger.kernel.org" Date: Mon, 25 Apr 2016 12:03:00 +0300 In-Reply-To: <20160421195329.GA10362@www.outflux.net> References: <20160421195329.GA10362@www.outflux.net> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1357 Lines: 44 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 Tested-by: Andy Shevchenko > Signed-off-by: Kees Cook > --- > 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 Intel Finland Oy