Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp356727pxb; Wed, 14 Apr 2021 17:42:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDstaXk1UAwI6xaX7wG9/1c/p9VdfqODUPBu8pnLvKgB+E3KCev8gMYKwwqyGsdaYOFUKy X-Received: by 2002:a17:906:5248:: with SMTP id y8mr735140ejm.150.1618447334919; Wed, 14 Apr 2021 17:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447334; cv=none; d=google.com; s=arc-20160816; b=Jd49b8Ok6ltJAUvtmTwtSBdPHA9i9DQGbpQbBaDQ6pgtUy9o/x9iN8lCuVX4j5InX6 EeeEXmQ0u3cqV7Aw9PxPQTGLXScf/obfOLsIf9lr9hG6+/JmtulqyGjlq30+u7dYW96r BRiOA0M9Ec1ZippBFT3dc42DEyIYEF1Kqd0OC4lD0kbaKSEiomWaLofpb87KEkIHkE1S 7sJkoR03mHlaAdAtsCq9StmRcSt4065T35WuKNq2OxZThplycNLpO0SiV9U6v7jalnVH HWnNnz0HKr9PWDi6EUPPAshHEJjtvSh/FmAG6rOrEcum1V3XTpw0fymLkCtN7iFGeMsY NQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iKpzGlS7wIN9NtejCZBzUxPCxGtKkwesJZSISyDAyBY=; b=ma2fypCJPmGWP+nKpDRVgUftawJUC3B0YPvJyCEggug77I3cxS9idRufYAVhZzzURm 4F+yR/5vBuCuNMWjWcxAX2owMrPHE4dNrCw3YKRXpZcJHzwqwc2LVK4E86ZHr0DX1rcE dxEz1GQsKFVZifZgFr/ROK0uSiQ1e+jeQsrlmN9N3ml1CdONmDI0pUU7HaLHRwTlG+m6 dvi+MvEYSyYmzQLiBLp2lEJsbN3Ui4Uri9TEIGn+t32gwIPgJW9gQSGECSTt54Y9h2XW aEzHeggfQYV33bSA10139/u84zMHDDHV1VQExp8M6GYYlP5fqtIyxaJkuVWWJXP2m1Rv nu+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sIrwRXqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf5si892529edb.64.2021.04.14.17.41.52; Wed, 14 Apr 2021 17:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sIrwRXqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233352AbhDNS5U (ORCPT + 99 others); Wed, 14 Apr 2021 14:57:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:54294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233309AbhDNS5O (ORCPT ); Wed, 14 Apr 2021 14:57:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7613608FC; Wed, 14 Apr 2021 18:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618426613; bh=p3tLoI1W999gvkPwHx3SIXj0hp7y62K3IG6+a/DlgTg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sIrwRXqtQKqDOgVLarJP5tde7bi9xdvtgd0Vnm+O16WlBakzQhsmopxiIiEArN7gL lv0UdAeWoVWwwaw8hEDvJxt+8a3j0fijCwtqzcRtaJz3cHrkVONx2qTT2lZoeL2bQ6 VwQaCSXI4T1lqFfdn4LjJ+yujMedwyifWsN0zr2g= Date: Wed, 14 Apr 2021 20:56:50 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: Alexander Shishkin , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16] Message-ID: References: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> <20210414171251.14672-3-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 08:47:48PM +0300, Andy Shevchenko wrote: > On Wed, Apr 14, 2021 at 07:33:38PM +0200, Greg Kroah-Hartman wrote: > > On Wed, Apr 14, 2021 at 08:12:46PM +0300, Alexander Shishkin wrote: > > > From: Andy Shevchenko > > > > > > It appears that uuid_t use in STM code abuses UUID API. > > > > How is it being abused? > > We are using it against the buffer that is u8, and neither uuid_t nor guid_t. And how should it be used? > > Moreover, > > > this type is only useful when we parse user input. Due to above > > > replace uuid_t with u8 uuid[16] and use uuid_t only when parse > > > user input. > > > > > > Signed-off-by: Andy Shevchenko > > > Signed-off-by: Alexander Shishkin > > > --- > > > drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ > > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/hwtracing/stm/p_sys-t.c b/drivers/hwtracing/stm/p_sys-t.c > > > index 360b5c03df95..04d13b3785d3 100644 > > > --- a/drivers/hwtracing/stm/p_sys-t.c > > > +++ b/drivers/hwtracing/stm/p_sys-t.c > > > @@ -76,7 +76,7 @@ enum sys_t_message_string_subtype { > > > MIPI_SYST_SEVERITY(MAX)) > > > > > > struct sys_t_policy_node { > > > - uuid_t uuid; > > > + u8 uuid[UUID_SIZE]; > > > > This feels wrong, what is wrong with the uuid_t type usage here? > > Nothing, just will require additional export_uuid() / import_uuid() call. Isn't that the "correct way" here? > > > bool do_len; > > > unsigned long ts_interval; > > > unsigned long clocksync_interval; > > > @@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) > > > { > > > struct sys_t_policy_node *pn = priv; > > > > > > - generate_random_uuid(pn->uuid.b); > > > > Ok, that's not good, but that looks to be a flaw in the > > generate_random_uuid() api, not this driver implementation. > > > > I don't understand why this change is needed? > > Using raw buffer APIs against uuid_t / guid_t. So you want to do that, or you do not want to do that? Totally confused, greg k-h