Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp354416pxb; Wed, 14 Apr 2021 17:37:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX04p4J6fuTdD+6QUOXUyU8AEM2ywCqMUqp+YCCIswRqsgpJ4phKm4XCxh+kprOvnwpeQb X-Received: by 2002:a17:902:db01:b029:eb:36ed:36f4 with SMTP id m1-20020a170902db01b02900eb36ed36f4mr947270plx.61.1618447066759; Wed, 14 Apr 2021 17:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447066; cv=none; d=google.com; s=arc-20160816; b=Ji/ETFbUpZ3/6M50+f/GR5I40/ySahxxbT7CMhD6vHtzB5OWf/p9OpA59P2shM3bHT ETs/xfxRITPFJcQ+sEkZwp1z8HXD8SScNhluKAiP8IdzBRgwlGan4RqwRVeQr11r4Zil U9UbESrq1PgcOhGNYW6pcj6RyNUcLs4wtBoaPiZtcWuu0isg1zTlqIb4RCqQu5P2Yhn4 sC4EIpCovBQZVsmQ72a3RCrUdSHlf1ZPriv85Zz9bZJJ+F5YIGYHY3VDpDin/4n+0aKS wkgDknrlGJjz3yCKLOB0xF13k/S5krvAaPY7h9Lh5i7LsD6jDXkd7CIogERDLz2K1vWl faKQ== 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=qKqMOOQze/lYHm5H8g6Um/wKr0p/vyVYYK3yjAW64mw=; b=gM1d7Xs0kNxN0YO8DDOXN3jCj7xvPgoVYKDeeto+tARMF0owslu1Z98PoZoS2utS35 CadzaFWE104/aT4f1iRQgEdo6MGt3cppIVhs1seElI/svto631vhpjFZXAD124k0n705 9ZYszh8AJrJMcv3Ne6M5IFj25kFfQ6Ze23+sEzs7xJUHZR43H2fb1tWme0AYucJkU/Oa 5ThWPly/lUD6/3naK8KMPfoZ/9yQMsNEt6nrliz0s1WgPDcig1A5f0V+ydioKi3n4/5j eliN/ypaK87vi2h+4nk7qXfnTsNLA3Km/ASpd6/36MrqlbEi8lTDf2I1TEQZhWKjdhNE rI5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qn0/r+tB"; 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 gi23si1237453pjb.22.2021.04.14.17.37.34; Wed, 14 Apr 2021 17:37:46 -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="Qn0/r+tB"; 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 S1350821AbhDNReD (ORCPT + 99 others); Wed, 14 Apr 2021 13:34:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:57208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350349AbhDNReC (ORCPT ); Wed, 14 Apr 2021 13:34:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 38E6361166; Wed, 14 Apr 2021 17:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618421620; bh=PJUmT8WDN96jpWmlRACj+k3ZBdDsEkZBPFuL4PHT6dc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qn0/r+tButd2tzkPURJUKQIaV9FEKjkqF53JS7Zwqy9vbSQ8Bqn+Kd6LzkPizYY9w qON8pHGnGjPv5lmJAkfNnDJ60erG0NvTyOeFmRD6Gu5Y5gE6LQJNhTzqoYW0ypbd6x CicKhLzgAjmXDcP6AEFR90c5DRI2xyL/CQoECX24= Date: Wed, 14 Apr 2021 19:33:38 +0200 From: Greg Kroah-Hartman To: Alexander Shishkin Cc: linux-kernel@vger.kernel.org, Andy Shevchenko 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: <20210414171251.14672-3-alexander.shishkin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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? > 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? thanks, greg k-h