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


Groups > linux.kernel > #1666853

Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors
Date 2017-06-15 18:30 +0200
Message-ID <tSFOG-4JC-17@gated-at.bofh.it> (permalink)
References <tSi5I-6MW-17@gated-at.bofh.it> <tSi5I-6MW-19@gated-at.bofh.it> <tSl3A-9p-19@gated-at.bofh.it> <tSFvk-4D9-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <stdio.h>
#include <stdlib.h>

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

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


Thread

[PATCH 0/6] staging: lustre: lustre: assortment of checkpatch cleanups James Simmons <jsimmons@infradead.org> - 2017-06-14 17:10 +0200
  [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch James Simmons <jsimmons@infradead.org> - 2017-06-14 17:10 +0200
    Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues  reported by checkpatch Joe Perches <joe@perches.com> - 2017-06-14 20:30 +0200
      Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues  reported by checkpatch James Simmons <jsimmons@infradead.org> - 2017-06-15 18:40 +0200
        Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues  reported by checkpatch Joe Perches <joe@perches.com> - 2017-06-15 19:00 +0200
  Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces  between elements" checkpatch errors Joe Perches <joe@perches.com> - 2017-06-14 20:20 +0200
    Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between  elements" checkpatch errors James Simmons <jsimmons@infradead.org> - 2017-06-15 18:10 +0200
      Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces  between elements" checkpatch errors Joe Perches <joe@perches.com> - 2017-06-15 18:30 +0200
        Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between  elements" checkpatch errors James Simmons <jsimmons@infradead.org> - 2017-06-15 19:00 +0200
          Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces  between elements" checkpatch errors Joe Perches <joe@perches.com> - 2017-06-15 19:10 +0200
            Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between  elements" checkpatch errors James Simmons <jsimmons@infradead.org> - 2017-06-15 19:20 +0200
  Re: [PATCH 5/6] staging: lustre: lustre: several over 80 characters  cleanups Joe Perches <joe@perches.com> - 2017-06-14 20:20 +0200
    Re: [PATCH 5/6] staging: lustre: lustre: several over 80 characters  cleanups James Simmons <jsimmons@infradead.org> - 2017-06-15 18:10 +0200
      Re: [PATCH 5/6] staging: lustre: lustre: several over 80 characters  cleanups Joe Perches <joe@perches.com> - 2017-06-15 18:20 +0200

csiph-web