From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbdFOQTv (ORCPT ); Thu, 15 Jun 2017 12:19:51 -0400 Received: from smtprelay0136.hostedemail.com ([216.40.44.136]:53865 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752121AbdFOQTs (ORCPT ); Thu, 15 Jun 2017 12:19:48 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:981:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:5007:6119:7903:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12740:12760:12895:13069:13255:13311:13357:13439:14181:14659:14721:21080:21451:21627:30012:30051:30054:30060:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: bit58_554ba1440581a X-Filterd-Recvd-Size: 2449 Message-ID: <1497543584.14396.8.camel@perches.com> Subject: Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors From: Joe Perches To: James Simmons Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Linux Kernel Mailing List , Lustre Development List Date: Thu, 15 Jun 2017 09:19:44 -0700 In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-06-15 at 17:03 +0100, James Simmons wrote: > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > Due to the way the DFID was embedded in our debug strings checkpatch > > > would report the following error: > > > > unrelated trivia > > > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > > > > [] > > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > > #define FID_NOBRACE_LEN 40 > > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > > > It's odd to use a mixture of %#x and 0x%x. > > > > Using > > #define DFID_NOBRACE "%#llx:%#x:%#x" > > would also save a couple bytes per use. > > Changing that format would break things very badly. This is used in user > land utilities and the kernel code. Really? Why would anything break? $ cat fmt.c #include #include int main(int argc, char **argv) { printf("%#llx:0x%x:0x%x\n", (unsigned long long)1, 2, 3); printf("%#llx:%#x:%#x\n", (unsigned long long)1, 2, 3); return 0; } $ gcc fmt.c $ ./a.out 0x1:0x2:0x3 0x1:0x2:0x3