Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format

From: Andy Shevchenko
Date: Wed Apr 06 2016 - 07:02:17 EST


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 <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy