Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756125AbaBUWsQ (ORCPT ); Fri, 21 Feb 2014 17:48:16 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:50710 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754023AbaBUWsP (ORCPT ); Fri, 21 Feb 2014 17:48:15 -0500 Date: Fri, 21 Feb 2014 16:48:10 -0600 From: Serge Hallyn To: Joe Perches Cc: Serge Hallyn , linux-security-module , LKML Subject: Re: [PATCH] capability: Use current logging styles Message-ID: <20140221224810.GA24302@sergelap> References: <1393021170.2594.24.camel@joe-AO722> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1393021170.2594.24.camel@joe-AO722> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Joe Perches (joe@perches.com): > Prefix logging output with "capability: " via pr_fmt. > Convert printks to pr_. > Use pr__once instead of guard flags. > Coalesce formats. > > Signed-off-by: Joe Perches Thanks. Acked-by: Serge E. Hallyn > --- > kernel/capability.c | 29 ++++++++++------------------- > 1 file changed, 10 insertions(+), 19 deletions(-) > > diff --git a/kernel/capability.c b/kernel/capability.c > index 34019c5..a8d63df 100644 > --- a/kernel/capability.c > +++ b/kernel/capability.c > @@ -7,6 +7,8 @@ > * 30 May 2002: Cleanup, Robert M. Love > */ > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > #include > #include > #include > @@ -42,15 +44,10 @@ __setup("no_file_caps", file_caps_disable); > > static void warn_legacy_capability_use(void) > { > - static int warned; > - if (!warned) { > - char name[sizeof(current->comm)]; > - > - printk(KERN_INFO "warning: `%s' uses 32-bit capabilities" > - " (legacy support in use)\n", > - get_task_comm(name, current)); > - warned = 1; > - } > + char name[sizeof(current->comm)]; > + > + pr_info_once("warning: `%s' uses 32-bit capabilities (legacy support in use)\n", > + get_task_comm(name, current)); > } > > /* > @@ -71,16 +68,10 @@ static void warn_legacy_capability_use(void) > > static void warn_deprecated_v2(void) > { > - static int warned; > + char name[sizeof(current->comm)]; > > - if (!warned) { > - char name[sizeof(current->comm)]; > - > - printk(KERN_INFO "warning: `%s' uses deprecated v2" > - " capabilities in a way that may be insecure.\n", > - get_task_comm(name, current)); > - warned = 1; > - } > + pr_info_once("warning: `%s' uses deprecated v2 capabilities in a way that may be insecure\n", > + get_task_comm(name, current)); > } > > /* > @@ -380,7 +371,7 @@ bool has_capability_noaudit(struct task_struct *t, int cap) > bool ns_capable(struct user_namespace *ns, int cap) > { > if (unlikely(!cap_valid(cap))) { > - printk(KERN_CRIT "capable() called with invalid cap=%u\n", cap); > + pr_crit("capable() called with invalid cap=%u\n", cap); > BUG(); > } > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/