lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1464784367.1767.8.camel@linux.intel.com>
Date:	Wed, 01 Jun 2016 15:32:47 +0300
From:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:	Joe Perches <joe@...ches.com>,
	George Spelvin <linux@...encehorizons.net>
Cc:	akpm@...ux-foundation.org, bbjorn@...k.no,
	linux-kernel@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH] lib/uuid.c: eliminate uuid_[bl]e_index arrays

On Tue, 2016-05-31 at 14:36 -0700, Joe Perches wrote:
> On Tue, 2016-05-31 at 16:31 -0400, George Spelvin wrote:
> > Here's a patch implementing the suggestion I made earlier.  This
> > reduces
> > code size, data size, and run time for input and output of UUIDs.
> []
> > diff --git a/lib/uuid.c b/lib/uuid.c
> []
> > @@ -97,32 +97,28 @@ bool uuid_is_valid(const char *uuid)
> >  }
> >  EXPORT_SYMBOL(uuid_is_valid);
> >  
> > -static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8
> > ei[16])
> > +static int __uuid_to_bin(const char uuid[36], __u8 b[16], const u8
> > si[16])
> 
> Functions with sized array arguments are generally undesired.

That function follows existing UUID API. Since we have now it
consolidated in one place someone may fix it eventually.

Refer to this discussion as well:
http://www.spinics.net/lists/linux-efi/msg08105.html

> 
> Linus once wrote: (http://comments.gmane.org/gmane.linux.kernel/203140
> 0)
> 
>     array arguments in C don't
>     actually exist. Sadly, compilers accept it for various bad
> historical
>     reasons, and silently turn it into just a pointer argument. There
> are
>     arguments for them, but they are from weak minds.
> 
> Perhaps this would be better using simple pointers and without the __
> 
> static int __uuid_to_bin(const char *uuid, u8 *b, const u8 *si)
> 

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ