Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1044884AbdDWK31 convert rfc822-to-8bit (ORCPT ); Sun, 23 Apr 2017 06:29:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:43050 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1044826AbdDWK3U (ORCPT ); Sun, 23 Apr 2017 06:29:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,238,1488873600"; d="scan'208";a="77795051" From: "Winkler, Tomas" To: Andy Shevchenko , Andrew Morton , "linux-kernel@vger.kernel.org" , Arnd Bergmann , "Mika Westerberg" , "alsa-devel@alsa-project.org" , "linux-input@vger.kernel.org" , "kvm@vger.kernel.org" , "devel@linuxdriverproject.org" , "linux-efi@vger.kernel.org" , "linux-acpi@vger.kernel.org" CC: Liam Girdwood , Mark Brown , "Koul, Vinod" , Srinivas Pandruvada , Benjamin Tissoires , Kirti Wankhede , Alex Williamson , "K. Y. Srinivasan" , Haiyang Zhang , "Stephen Hemminger" , Matt Fleming , Ard Biesheuvel , "Rafael J. Wysocki" Subject: RE: [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers Thread-Topic: [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers Thread-Index: AQHSuq4ryU4x8feEVEm7l2P5RMMZXKHSws4A Date: Sun, 23 Apr 2017 10:29:14 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B543E8399@hasmsx108.ger.corp.intel.com> References: <20170421144645.45189-1-andriy.shevchenko@linux.intel.com> In-Reply-To: <20170421144645.45189-1-andriy.shevchenko@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWYyYmQ2ODYtNTY5My00N2I0LWIzOTctNjNmZTkyNzgyMmZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjNicGdqTGRsamJvQkNWZjE0NnV1MUxtYUhZY1JCVUpsWDVoNk1CMWN0Mjg9In0= dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2075 Lines: 55 > New helpers take pointers to uuid_{be|le} as parameters. > > When using them on a raw data we don't need to do an ugly dereference and, > in some cases, a type casting. > > Cc: Andrew Morton > Cc: Arnd Bergmann > Cc: Liam Girdwood > Cc: Mark Brown > Cc: Vinod Koul > Cc: Srinivas Pandruvada > Cc: Benjamin Tissoires > Cc: Kirti Wankhede > Cc: Alex Williamson > Cc: "K. Y. Srinivasan" > Cc: Haiyang Zhang > Cc: Stephen Hemminger > Cc: Tomas Winkler > Cc: Matt Fleming > Cc: Ard Biesheuvel > Cc: "Rafael J. Wysocki" > > Signed-off-by: Andy Shevchenko > --- > include/linux/uuid.h | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/include/linux/uuid.h b/include/linux/uuid.h index > 4dff73a89758..45312cb5ac65 100644 > --- a/include/linux/uuid.h > +++ b/include/linux/uuid.h > @@ -58,6 +58,26 @@ static inline int uuid_be_cmp(const uuid_be u1, const > uuid_be u2) > return memcmp(&u1, &u2, sizeof(uuid_be)); } > > +static inline int uuid_le_cmp_p(const uuid_le *pu1, const uuid_le u2) { > + return memcmp(pu1, &u2, sizeof(uuid_le)); } > + > +static inline int uuid_be_cmp_p(const uuid_be *pu1, const uuid_be u2) { > + return memcmp(pu1, &u2, sizeof(uuid_be)); } > + > +static inline int uuid_le_cmp_pp(const uuid_le *pu1, const uuid_le > +*pu2) { > + return memcmp(pu1, pu2, sizeof(uuid_le)); } > + > +static inline int uuid_be_cmp_pp(const uuid_be *pu1, const uuid_be > +*pu2) { > + return memcmp(pu1, pu2, sizeof(uuid_be)); } > + > void generate_random_uuid(unsigned char uuid[16]); > > extern void uuid_le_gen(uuid_le *u); I think this going overboard, the _pp types are just enough. Tomas