Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2307904rbb; Tue, 27 Feb 2024 18:59:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXoZgtUEreNIbcmRKTUGI/WUN9jE/6gr0l071zHB1mu+r/Y6Jw1SaNTzzcXz69zABaLQURnPVayfs4ezGSmq32X3xpTW0Q3xv96Cv62ow== X-Google-Smtp-Source: AGHT+IGmOy8ciQbgsnKNdG/MdvNdKcyg0B4VLbIe5ddAwAMQBPjTv69medxK6VClbN5wD6dDw2xy X-Received: by 2002:a05:622a:15c1:b0:42e:3f7f:4119 with SMTP id d1-20020a05622a15c100b0042e3f7f4119mr14441839qty.38.1709089169274; Tue, 27 Feb 2024 18:59:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709089169; cv=pass; d=google.com; s=arc-20160816; b=ksu+fjiYGkujYk5Q2n+NIAFlN3ciU8/g65FEAx8jsbgpC64WRjssA8+MQUgcbLIyP0 JfopqFz36208ltPzfKI5jzmr2y3LAjR3SiKewAVmO9vkdyPtYh6qV0YUuuuXMsPys/WU yaSD7LD7ttXl1+Rl4LJcfP3ZSTU//N07X1J7qRP7Tu1fvkHI2TSH4HnYpSUSCJPPVWsb PnDrkBnmbCUt4m+5CBMvWpuj5wPwwEbTTOYpPUZf84qYRFD5lSChjSB4Wy5CewYo7fyj 61OgIi4xi7LHqLu5wq+mOwjGvEAIOZ9IkBvnqUeDdsfU0vjWX5+e1tJeacsRr5IXKKr2 0toA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RO9X5sKVt7AeAWHf5VFIapm3+9P8ZMEYI1LV6fzAfYU=; fh=uWu9MeyGkywR165s6yDWPgkXRNiae1Qrt207vzeAVio=; b=vcTuYv2Dbg5ETV67A/Io4XoSWSB/2VSXvey8IYmjKAPNXHdLnPY63HrDDe4E8ZQJRS phE7UUfsR3DTu0c6BFxgdehBRggHrbhKDoirRtlLpvSU6mwZ7jutsMbduPbXp2IBWIwS QgkZil1ZC7WT8KbXhP6XPeYVT/B45yqsfjbjH043Lxymyibj/GEW0nLVI38ZK9qBMOPl ZSX7Bo/of2pKsxlhyvy7Qj1EWC4INdTDnMMITcuoXME2mS4pweD95XC+V9P8A2Sux/0j HtTJzerIiGRVG+f8R30epPv4wISvWJAb8ba2tdmfrZJZCDor6M2YjI3nSXjObo/e1S6z b3ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T9lQDdkj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-84456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h18-20020ac87152000000b0042c23be6994si8430872qtp.488.2024.02.27.18.59.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 18:59:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T9lQDdkj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-84456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F31AC1C25882 for ; Wed, 28 Feb 2024 02:59:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63FDB1CFAC; Wed, 28 Feb 2024 02:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T9lQDdkj" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 198671CD24; Wed, 28 Feb 2024 02:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709089162; cv=none; b=BOS4/sBy2ymnWhSRK08aAHlwIpeJjCxnlxpqeIvhzBiK8s987XkRLWyZ0rr2wxC+Prwz3i23admP32VIR5KypBKWm5UElt8g5C+dyFJtI9z2hu8TDeVqDLCnjQ4cODaG2JpWab8Ee/0FmbmQAakGwVAI+qOI7P8Jmgr1fAAvGmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709089162; c=relaxed/simple; bh=+Z1tIfGnJXnPWTFBKhO7BGRahx2cBbP1PxxMCAfAlVI=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=sfQ52HLNAJE2nzG3ZgUg13uXypk/1pkzXtly4UgTJTLrfuEwRaTEeU/wzb71RYe8nXhk0jLMoI+HZ+lHGYEm06EqezyaWOGzjetgp1Yt6I4RHmQ4bEl6jauQPEEXrkCfzZM0OfPhdeMef0fQejTBdiyxLb7oUkcHGAsWshz44aA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=T9lQDdkj; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709089161; x=1740625161; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=+Z1tIfGnJXnPWTFBKhO7BGRahx2cBbP1PxxMCAfAlVI=; b=T9lQDdkjF6dP/Ho3pRf6FI+2BSRPRiOiO9wHe321j/vgs3i3sSRC3gG1 LEyEmtuHznIqH/vKAfnmtc1T4451E9T75M67fVA5g0Go5ycbuJtyp1YaU 5yjny9xZb7XQpjqVvV7VHUWf/WP//3RnKVWku8pDE29GDY24KqnI++Cbv c0sL/GGVpOg5tfrL3BabtEXiGk8tm41KDhV4eoNLyJ6coEyybKKzdzxwc bmpyD1vCGBAcr9jGIB1JLErrmV/xLL3OvOtfx4TgNxsX/CV6JMANWqOni 9l/VJe2UFo80Rtxyx8zduqjHk3yVj9vyDxRawMjkzmGulGyG1R15BEACJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3329191" X-IronPort-AV: E=Sophos;i="6.06,189,1705392000"; d="scan'208";a="3329191" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 18:59:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,189,1705392000"; d="scan'208";a="11837304" Received: from dschro4x-mobl.amr.corp.intel.com (HELO [10.212.137.190]) ([10.212.137.190]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 18:59:20 -0800 Message-ID: <5149642c-4718-4ce4-a0e0-5648260aa04a@linux.intel.com> Date: Tue, 27 Feb 2024 18:59:19 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 8/9] platform/x86/intel/sdsi: Simplify ascii printing Content-Language: en-US To: "David E. Box" , rajvi.jingar@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com References: <20240228000016.1685518-1-david.e.box@linux.intel.com> <20240228000016.1685518-9-david.e.box@linux.intel.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240228000016.1685518-9-david.e.box@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/27/24 4:00 PM, David E. Box wrote: > Use printf width specifier to set the display length of encoded feature > names. > > Signed-off-by: David E. Box > --- Looks fine to me. Reviewed-by: Kuppuswamy Sathyanarayanan > V2 - Split of V1 patch 7 > > tools/arch/x86/intel_sdsi/intel_sdsi.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/tools/arch/x86/intel_sdsi/intel_sdsi.c b/tools/arch/x86/intel_sdsi/intel_sdsi.c > index 2acc6be5f5d6..a8fb6d17405f 100644 > --- a/tools/arch/x86/intel_sdsi/intel_sdsi.c > +++ b/tools/arch/x86/intel_sdsi/intel_sdsi.c > @@ -407,11 +407,10 @@ static int sdsi_meter_cert_show(struct sdsi_dev *s) > > printf("Number of Feature Counters: %d\n", mc->bundle_length / 8); > while (count < mc->bundle_length / 8) { > - char feature[5]; > + char feature[4]; > > - feature[4] = '\0'; > get_feature(bec[count].encoding, feature); > - printf(" %s: %d\n", feature, bec[count].counter); > + printf(" %.4s: %d\n", feature, bec[count].counter); > ++count; > } > > @@ -492,7 +491,7 @@ static int sdsi_state_cert_show(struct sdsi_dev *s) > sizeof(*lki) + // size of the license key info > offset; // offset to this blob content > struct bundle_encoding *bundle = (void *)(lbc) + sizeof(*lbc); > - char feature[5]; > + char feature[4]; > uint32_t i; > > printf(" Blob %d:\n", count - 1); > @@ -505,11 +504,9 @@ static int sdsi_state_cert_show(struct sdsi_dev *s) > printf(" Blob revision ID: %u\n", lbc->rev_id); > printf(" Number of Features: %u\n", lbc->num_bundles); > > - feature[4] = '\0'; > - > for (i = 0; i < min(lbc->num_bundles, STATE_MAX_NUM_IN_BUNDLE); i++) { > get_feature(bundle[i].encoding, feature); > - printf(" Feature %d: %s\n", i, feature); > + printf(" Feature %d: %.4s\n", i, feature); > } > > if (lbc->num_bundles > STATE_MAX_NUM_IN_BUNDLE) -- Sathyanarayanan Kuppuswamy Linux Kernel Developer