From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758577AbcFAPHJ (ORCPT ); Wed, 1 Jun 2016 11:07:09 -0400 Received: from science.sciencehorizons.net ([71.41.210.147]:55367 "HELO ns.sciencehorizons.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with SMTP id S1758065AbcFAPHH (ORCPT ); Wed, 1 Jun 2016 11:07:07 -0400 Date: 1 Jun 2016 11:07:05 -0400 Message-ID: <20160601150705.27355.qmail@ns.sciencehorizons.net> From: "George Spelvin" To: andriy.shevchenko@linux.intel.com, joe@perches.com, linux@sciencehorizons.net Subject: Re: [PATCH] lib/uuid.c: eliminate uuid_[bl]e_index arrays Cc: akpm@linux-foundation.org, bbjorn@mork.no, linux-kernel@vger.kernel.org, tytso@mit.edu In-Reply-To: <1464784367.1767.8.camel@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 01 Jun 2016 at 15:32:47, Andy Shevchenko wrote: > On Tue, 2016-05-31 at 14:36 -0700, Joe Perches wrote: >> On Tue, 2016-05-31 at 16:31 -0400, George Spelvin wrote: >>> -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. Just to clarify: int foo(char *); int foo(char *floccinaucinihilipilifcation); int foo(char *p); int foo(char p[]); int foo(char []); int foo(char p[1]); int foo(char p[999999999]); are all the exact same declaration. There is no API change; the only difference is stylistic. (Try it! Copy them to a .c file and compile it. Observe the lack of conflicting declaration warnings.) Although the compiler doesn't care, I happen to prefer to include parameter names for the benefit of someone reading the header files. For the same reason, if the pointer is to the start of an array with definite length (that's not 1), I prefer to use the array form showing that length. But it's a matter of style, not substance, either way.