Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372402

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

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format
Date 2016-04-06 13:10 +0200
Message-ID <rkTvr-2UJ-7@gated-at.bofh.it> (permalink)
References <rkzGq-4wA-9@gated-at.bofh.it> <rkzGs-4wA-41@gated-at.bofh.it> <rkIqm-33z-5@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


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@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/10] uuid: convert users to generic UUID API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
  [PATCH v3 03/10] lib/uuid: move generate_random_uuid() to uuid.c Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
  [PATCH v3 06/10] sysctl: drop away useless label Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
    Re: [PATCH v3 06/10] sysctl: drop away useless label Andrew Morton <akpm@linux-foundation.org> - 2016-04-06 00:20 +0200
      Re: [PATCH v3 06/10] sysctl: drop away useless label Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-06 13:40 +0200
  [PATCH v3 08/10] efi: redefine type, constant, macro from generic code Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
  [PATCH v3 02/10] ima: use %pU to output UUID in printable format Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
    Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format Joe Perches <joe@perches.com> - 2016-04-06 01:20 +0200
      Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-06 13:10 +0200
  [PATCH v3 09/10] efivars: use generic UUID library Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
  [PATCH v3 07/10] sysctl: use generic UUID library Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
  [PATCH v3 04/10] lib/uuid: introduce few more generic helpers for UUID Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:00 +0200
    Re: [PATCH v3 04/10] lib/uuid: introduce few more generic helpers  for UUID Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-05 16:20 +0200

csiph-web