From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F9534550C; Thu, 27 Jun 2024 17:06:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 536A142D97; Thu, 27 Jun 2024 17:06:55 +0200 (CEST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 5717B42D89 for ; Thu, 27 Jun 2024 17:06:54 +0200 (CEST) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2c70c08d98fso6286852a91.0 for ; Thu, 27 Jun 2024 08:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1719500813; x=1720105613; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=1G/JzEjQzzgP17pSidYMPJMBFXe7yHXCeMkH9QIVHOU=; b=vwCbSREAH+HF5gO6zc4jkPS1SXq1CQG8+9JSQoC3SUQCoNFksEawM4AgmRBNupBl4n UBQl6uUluSOHSMsvece6mcRbvC3PIzAQ6u99ApMlliw2qgik8D8KniIhIGwfEin7tTuM pg19jDfrG/b1ma9NMMIHpjApObJti4Kf4RBnRafKdkOnJA8VOGJtUTOaWrrAeci4ZaUh YrH2ACOTzIp4bynNLlSmOXslKOjCcQ70r5mM8FRTziYzA0d+5DdHlZxr18ysfkpVM8Qe XJtIfy2CwhBaZ2xIfYGX6wDWEoXP+VSXrMtik4NXoJeAAUuZAfkS+5PDdVVyTkXGQhvc YEig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719500813; x=1720105613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1G/JzEjQzzgP17pSidYMPJMBFXe7yHXCeMkH9QIVHOU=; b=VTK9aFyfA9Svy671+ujQpRfOuHsacRcGpgiXUVPjo26EfzAy0R545jGzqfcPNiJR1K eh5Lxc3bwioCTpTB3NAMfkD+g2SpEIgzY+eMZF4pwlicF+r6OdMJKkGUktYJlf8v+sEv 4J+yh0bmsarz9bECcAfQzPXBaK1ZRBcAv2E0YwgAIfKir3WhQNjIzBcJDGteXtgJ2+AC RZBthE1fP0EQZgEiZRtc/vHQ/17rwm/ZFo8Yf8FCH0v3YVV07q9rphzIWmvLBRM9uCXR dk+FikF4vKlqMBXx0lHiKlRYSthyfBjRq4cpFXsrEpt1QxR5VM5DSbmyDyzd/RIUCZOb o84g== X-Gm-Message-State: AOJu0Yz85Ji4XHODauTQuKHQh5p+Yb4bAlRl1pulEevZIh1C5pdjnp9G zKhoWXuQK+gFj7S29Pj0gVIVZ9quWjWyyBesG2RX+5jm/GFqyFaNS44PSib9g7I= X-Google-Smtp-Source: AGHT+IGssS4eu4bjy5q54RhkHG9kX/94KF0fo8W88muLlrnZg3bjJGWtzaFM/llBL4NNu8ZXBb8//g== X-Received: by 2002:a17:90b:1198:b0:2c2:1d86:f785 with SMTP id 98e67ed59e1d1-2c85829755cmr10924583a91.47.1719500813201; Thu, 27 Jun 2024 08:06:53 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fe8d06fasm1592197a91.15.2024.06.27.08.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 08:06:53 -0700 (PDT) Date: Thu, 27 Jun 2024 08:06:51 -0700 From: Stephen Hemminger To: Huisong Li Cc: , , , , , , , , Subject: Re: [PATCH v4 1/2] power: introduce PM QoS API on CPU wide Message-ID: <20240627080651.57f898c8@hermes.local> In-Reply-To: <20240627060011.17816-2-lihuisong@huawei.com> References: <20240320105529.5626-1-lihuisong@huawei.com> <20240627060011.17816-1-lihuisong@huawei.com> <20240627060011.17816-2-lihuisong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 27 Jun 2024 14:00:10 +0800 Huisong Li wrote: > + char buf[BUFSIZ] = {0}; BUFSIZ is 4K and you probably don't need all of that. And initializing to 0 here should not be needed. Why not: char buf[LINE_MAX]; > + if (latency == 0) > + sprintf(buf, "%s", "n/a"); > + else if (latency == RTE_POWER_QOS_RESUME_LATENCY_NO_CONSTRAINT) > + sprintf(buf, "%u", 0); > + else > + sprintf(buf, "%u", latency); Use snprintf instead.