Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753102AbcDURMs (ORCPT ); Thu, 21 Apr 2016 13:12:48 -0400 Received: from mga14.intel.com ([192.55.52.115]:16948 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751719AbcDURMr (ORCPT ); Thu, 21 Apr 2016 13:12:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,513,1455004800"; d="scan'208";a="963673518" Message-ID: <1461258823.6620.322.camel@linux.intel.com> Subject: Re: [PATCH 5/6] fs: define a string representation of the kernel_read_file_id enumeration From: Andy Shevchenko To: Kees Cook Cc: James Morris , 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: Thu, 21 Apr 2016 20:13:43 +0300 In-Reply-To: References: <1461192388-13900-1-git-send-email-keescook@chromium.org> <1461192388-13900-6-git-send-email-keescook@chromium.org> <1461245188.6620.316.camel@linux.intel.com> 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: 1930 Lines: 51 On Thu, 2016-04-21 at 09:47 -0700, Kees Cook wrote: > On Thu, Apr 21, 2016 at 6:26 AM, Andy Shevchenko > wrote: > > > > On Wed, 2016-04-20 at 15:46 -0700, Kees Cook wrote: > > > > > > From: Mimi Zohar > > > > > > A string representation of the kernel_read_file_id enumeration is > > > needed for displaying messages (eg. pr_info, auditing) that can be > > > used by multiple LSMs and the integrity subsystem.  To simplify > > > keeping the list of strings up to date with the enumeration, this > > > patch defines two new preprocessing macros named __fid_enumify and > > > __fid_stringify to create the enumeration and an array of strings. > > > kernel_read_file_id_str() returns a string based on the > > > enumeration. > > I got this > > > > In file included from /home/andy/prj/linux- > > topic/include/linux/seq_file.h:10:0, > >                  from /home/andy/prj/linux- > > topic/include/linux/pinctrl/consumer.h:17, > >                  from /home/andy/prj/linux- > > topic/include/linux/pinctrl/devinfo.h:21, > >                  from /home/andy/prj/linux- > > topic/include/linux/device.h:24, > >                  from /home/andy/prj/linux- > > topic/include/linux/dmaengine.h:20, > >                  from /home/andy/prj/linux- > > topic/drivers/dma/dw/core.c:15: > > /home/andy/prj/linux-topic/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) > What gcc version are you using? Seems like I need to drop the added > "const" on the return? $ gcc --version gcc (Debian 5.3.1-14) 5.3.1 20160409 Build was done with  $ make W=1 -- Andy Shevchenko Intel Finland Oy