From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760055AbcDEXQa (ORCPT ); Tue, 5 Apr 2016 19:16:30 -0400 Received: from smtprelay0151.hostedemail.com ([216.40.44.151]:34103 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753195AbcDEXQ2 (ORCPT ); Tue, 5 Apr 2016 19:16:28 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1381:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2894:3138:3139:3140:3141:3142:3352:3622:3865:3866:3868:4321:5007:6737:10004:10400:10848:11026:11232:11658:11914:12043:12048:12296:12517:12519:12740:13069:13311:13357:13439:13894:14659:14721:21080:30004:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: chin14_1ab41937a0723 X-Filterd-Recvd-Size: 2019 Message-ID: <1459898182.6715.22.camel@perches.com> Subject: Re: [PATCH v3 02/10] ima: use %pU to output UUID in printable format From: Joe Perches To: Andy Shevchenko , 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: Tue, 05 Apr 2016 16:16:22 -0700 In-Reply-To: <1459864579-55988-3-git-send-email-andriy.shevchenko@linux.intel.com> References: <1459864579-55988-1-git-send-email-andriy.shevchenko@linux.intel.com> <1459864579-55988-3-git-send-email-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 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: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);