Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbcLLSOQ (ORCPT ); Mon, 12 Dec 2016 13:14:16 -0500 Received: from smtprelay0013.hostedemail.com ([216.40.44.13]:50825 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752840AbcLLSOP (ORCPT ); Mon, 12 Dec 2016 13:14:15 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973: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:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4361:5007:6119:7903:10004:10400:10848:11026:11232:11658:11914:12740:12760:13069:13161:13229:13311:13357:13439:14180:14181:14659:14721:21080:21433:30012:30034:30054:30070: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:3,LUA_SUMMARY:none X-HE-Tag: dress07_41d0353de0a10 X-Filterd-Recvd-Size: 2419 Message-ID: <1481566450.1764.23.camel@perches.com> Subject: Re: [PATCH 1/1] Fixed to codestyle From: Joe Perches To: Eric Sandeen , Ozgur Karatas , david@fromorbit.com Cc: linux-xfs@vger.kernel.org, linux-kernel Date: Mon, 12 Dec 2016 10:14:10 -0800 In-Reply-To: <66c68b88-e338-1d9a-b9dd-b8d858ebf349@sandeen.net> References: <987271481540010@web27o.yandex.ru> <66c68b88-e338-1d9a-b9dd-b8d858ebf349@sandeen.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 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 Content-Length: 1522 Lines: 53 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 > > 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_ > > 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 */ > > } > >