From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754277AbcDFLCN (ORCPT ); Wed, 6 Apr 2016 07:02:13 -0400 Received: from mga01.intel.com ([192.55.52.88]:55566 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbcDFLCK (ORCPT ); Wed, 6 Apr 2016 07:02:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="949185092" Message-ID: <1459940554.17884.75.camel@linux.intel.com> Subject: Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format From: Andy Shevchenko To: Joe Perches , Dmitry Kasatkin , Mimi Zohar , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Andrew Morton , Rasmus Villemoes , linux-efi@vger.kernel.org, Matt Fleming , Arnd Bergmann , "Theodore Ts'o" Date: Wed, 06 Apr 2016 14:02:34 +0300 In-Reply-To: <1459898182.6715.22.camel@perches.com> References: <1459864579-55988-1-git-send-email-andriy.shevchenko@linux.intel.com> <1459864579-55988-3-git-send-email-andriy.shevchenko@linux.intel.com> <1459898182.6715.22.camel@perches.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 On Tue, 2016-04-05 at 16:16 -0700, Joe Perches wrote: > On Tue, 2016-04-05 at 16:56 +0300, Andy Shevchenko wrote: > > > > Instead of open coded variant re-use extension what vsprintf.c > > provides us for > > ages. > trivia: > > > > > diff --git a/security/integrity/ima/ima_policy.c > > b/security/integrity/ima/ima_policy.c > [] > > > > @@ -1012,17 +1012,7 @@ int ima_policy_show(struct seq_file *m, void > > *v) > >   } > >   > >   if (entry->flags & IMA_FSUUID) { > > - seq_puts(m, "fsuuid="); > > - for (i = 0; i < ARRAY_SIZE(entry->fsuuid); ++i) { > > - switch (i) { > > - case 4: > > - case 6: > > - case 8: > > - case 10: > > - seq_puts(m, "-"); > > - } > > - seq_printf(m, "%x", entry->fsuuid[i]); > > - } > > + seq_printf(m, "fsuuid=%pU", entry->fsuuid); > >   seq_puts(m, " "); > >   } > Maybe combine the printf and puts > > seq_printf(m, "fsuuid=%pU ", entry->fsuuid); I would prefer my style to keep in order with the rest of the code in that file. -- Andy Shevchenko Intel Finland Oy