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


Groups > linux.kernel > #1540505

Re: [PATCH 1/1] Fixed to codestyle

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] Fixed to codestyle
Date 2016-12-12 19:20 +0100
Message-ID <sNDmF-7Fp-13@gated-at.bofh.it> (permalink)
References <sNwEx-3Ar-1@gated-at.bofh.it> <sNz9n-50m-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-12-12 at 07:49 -0600, Eric Sandeen wrote:
> On 12/12/16 4:53 AM, Ozgur Karatas wrote:
> > 
> > Hello,
> > 
> > I have error to use uuid and I think the functions should be used when -i'm eye-catching- "(* uuid)".
> > I tested it.
> > 
> > Regards,
> > 
> > Signed-off-by: Ozgur Karatas <okaratas@member.fsf.org>
> 
> NAK
> 
> This doesn't fix code style at all; there is no need and no
> precedence for i.e. (*uuid) in function arguments in the xfs code,
> and you have broken indentation in the loop within the function.

Perhaps better would be to convert the xfs uuid_t typedef
to the include/uapi/linux/uuid.h appropriate struct and
maybe use a comparison to NULL_UUID_<type>

> > diff --git a/fs/xfs/uuid.c b/fs/xfs/uuid.c
[]
> > @@ -33,7 +33,7 @@ typedef struct {
> >   * it just something that's needed for user-level file handles.
> >   */
> >  void
> > -uuid_getnodeuniq(uuid_t *uuid, int fsid [2])
> > +uuid_getnodeuniq(uuid_t (*uuid), int fsid [2])

And to amplify Eric's comment:

that bit is confusing as it makes uuid look
like a function pointer.

> >  {
> >  	xfs_uu_t *uup = (xfs_uu_t *)uuid;
> >  
> > @@ -51,8 +51,8 @@ uuid_is_nil(uuid_t *uuid)
> >  	if (uuid == NULL)
> >  		return 0;
> >  	/* implied check of version number here... */
> > -	for (i = 0; i < sizeof *uuid; i++)
> > -		if (*cp++) return 0;	/* not nil */
> > +	for (i = 0; i < sizeof (*uuid); i++) 
> > +	if (*cp++) return 0;	/* not nil */

There shouldn't be a space after sizeof.

> >  	return 1;	/* is nil */
> >  }
> > 

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


Thread

[PATCH 1/1] Fixed to codestyle Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-12 12:10 +0100
  Re: [PATCH 1/1] Fixed to codestyle Eric Sandeen <sandeen@sandeen.net> - 2016-12-12 14:50 +0100
    Re: [PATCH 1/1] Fixed to codestyle Joe Perches <joe@perches.com> - 2016-12-12 19:20 +0100
      Re: [PATCH 1/1] Fixed to codestyle Eric Sandeen <sandeen@sandeen.net> - 2016-12-12 19:40 +0100
        Re: [PATCH 1/1] Fixed to codestyle Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-12 21:40 +0100
          Re: [PATCH 1/1] Fixed to codestyle Eric Sandeen <sandeen@sandeen.net> - 2016-12-12 21:50 +0100
            Re: [PATCH 1/1] Fixed to codestyle Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-12 21:50 +0100
            Re: [PATCH 1/1] Fixed to codestyle Joe Perches <joe@perches.com> - 2016-12-12 22:00 +0100
              Re: [PATCH 1/1] Fixed to codestyle Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-12 22:00 +0100
              Re: [PATCH 1/1] Fixed to codestyle Eric Sandeen <sandeen@sandeen.net> - 2016-12-12 22:20 +0100
      Re: [PATCH 1/1] Fixed to codestyle Ozgur Karatas <okaratas@member.fsf.org> - 2016-12-12 21:40 +0100

csiph-web