Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp353630pxb; Wed, 14 Apr 2021 17:36:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS3Ofc94b3opvtYJbh9DYygisyLz3Qz0bTXFmhUK0mA+r6rOicbJpbIVplhfCJVJMmgPKm X-Received: by 2002:aa7:c3c3:: with SMTP id l3mr985183edr.103.1618446985223; Wed, 14 Apr 2021 17:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446985; cv=none; d=google.com; s=arc-20160816; b=Plw85OFwpQk+/60E4xlHWBWsoghaqcxj6r69z3Ez9JT/mvu6WZniPjgZbIuYkPjAWX EPWAqi9DzBX1ZO873UuCrRjlJtTo+L9Yvfs80p3wVDH8TkoLA6eLvhajUotq8SAunCfq ST5bV96uVi6B3Z2svMQT6V3oSGRjo7aqOq/GWg3kniNmkcBBgfwHZXHEkSU5dpObjD/0 OFkF1T4li7r53z9MHCZV4eoyDveP2fdkpooV7bTQs9hNZTOyKT85soaIQ2RFa3eWW/bZ D8JeK6lFnDnKRYrirOZBDZnZVhVkGvLKfUareqFsZyBVkLR/JqRyacDSQjCBySNfMi/q m2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=1Cq/KUnF3fygYXar0fwAeY+akCHD1Xy3QvAj7yKsCYU=; b=uPgdLROn7UG4HfPzC93W9IR+SIYZg2e3GFVsggJgK2IXYUJEPV9l0lxhF+DSqUlfVe 8DKpxT8pE2ZFjEgW7+11HyS692AHoC27gXcXm2GHSvHoyJxPERS5EYmnCUwh/IB54wKq FFduVMVZuW+x3OP7f8LUCNyAg0e5lO71DemcfbMfwP2tfeO2HsvvGVG94SvVpSmv1o1H auFibW7zvAbIiOtyi8UWPAbmmPVyxkdTeL4M8UK+ypjh7XhkRgHmlSll0Wp/IUc5OEOA wtGiG6D8Tc7+B42QrJru7ZTN2r5RDzmiL/sl1RrIb6PjtL1+NwE1DvTCWgOHXZnNOdmZ PKCQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si973598edw.509.2021.04.14.17.36.02; Wed, 14 Apr 2021 17:36:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241079AbhDNRNF (ORCPT + 99 others); Wed, 14 Apr 2021 13:13:05 -0400 Received: from mga02.intel.com ([134.134.136.20]:3013 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233433AbhDNRNE (ORCPT ); Wed, 14 Apr 2021 13:13:04 -0400 IronPort-SDR: T72mCPwBChFuXngrAT7moXLzxgoIkIr355i0UKw+23nbRyw1f3fsb3C+/MkMzP3QC+Jx+DzYS+ 2cj/0Qov+69Q== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="181811912" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="181811912" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 10:12:43 -0700 IronPort-SDR: H6BS4xofiw/LO7ZHS1dCEkOJzKxnMrHMBFfxTlre7khZ5UigqmoQG0To3ZizgcOFOZcMVf0xsU xKkgMu6XzqZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="382427932" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2021 10:12:40 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Alexander Shishkin Subject: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16] Date: Wed, 14 Apr 2021 20:12:46 +0300 Message-Id: <20210414171251.14672-3-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> References: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko It appears that uuid_t use in STM code abuses UUID API. 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]; 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); + generate_random_uuid(pn->uuid); } static int sys_t_output_open(void *priv, struct stm_output *output) @@ -120,7 +120,7 @@ static ssize_t sys_t_policy_uuid_show(struct config_item *item, { struct sys_t_policy_node *pn = to_pdrv_policy_node(item); - return sprintf(page, "%pU\n", &pn->uuid); + return sprintf(page, "%pU\n", pn->uuid); } static ssize_t @@ -129,13 +129,17 @@ sys_t_policy_uuid_store(struct config_item *item, const char *page, { struct mutex *mutexp = &item->ci_group->cg_subsys->su_mutex; struct sys_t_policy_node *pn = to_pdrv_policy_node(item); + uuid_t uuid; int ret; mutex_lock(mutexp); - ret = uuid_parse(page, &pn->uuid); + ret = uuid_parse(page, &uuid); mutex_unlock(mutexp); + if (ret) + return ret; - return ret < 0 ? ret : count; + export_uuid(pn->uuid, &uuid); + return count; } CONFIGFS_ATTR(sys_t_policy_, uuid); @@ -322,7 +326,7 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output, return sz; /* GUID */ - sz = stm_data_write(data, m, c, false, op->node.uuid.b, UUID_SIZE); + sz = stm_data_write(data, m, c, false, op->node.uuid, sizeof(op->node.uuid)); if (sz <= 0) return sz; -- 2.30.2