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 4DDA9A034F; Tue, 6 Apr 2021 12:05:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22B2B140FA5; Tue, 6 Apr 2021 12:05:45 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 814B2140F88 for ; Tue, 6 Apr 2021 12:05:42 +0200 (CEST) IronPort-SDR: dUnjw4XFwmXgrqFpeN/IrzlgpAmjOGkwTkmPLm9eSCt86VhUXUyQS8npFAVbSSTxHTQACy7ZqY F0vmEQUyiJKQ== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="278292914" X-IronPort-AV: E=Sophos;i="5.81,309,1610438400"; d="scan'208";a="278292914" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 03:05:35 -0700 IronPort-SDR: ESeKw38quhw96nlc4j9KS2jg5n8yWb2110dmy4YPBIKHKCIuXSvwwqZm9k5F3Dzoepu1bpZSAw 6RDQTiZNT9bQ== X-IronPort-AV: E=Sophos;i="5.81,309,1610438400"; d="scan'208";a="414707426" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.250.60]) ([10.213.250.60]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 03:05:34 -0700 To: Stephen Hemminger Cc: dev@dpdk.org References: <20210401150517.234085-1-anatoly.burakov@intel.com> <20210402104642.29f22bba@hermes.local> From: "Burakov, Anatoly" Message-ID: <89a8e353-c2b6-12dd-1228-10029f8824e5@intel.com> Date: Tue, 6 Apr 2021 11:05:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210402104642.29f22bba@hermes.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 21.08] power: refactor pstate sysfs handling 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 Sender: "dev" On 02-Apr-21 6:46 PM, Stephen Hemminger wrote: > On Thu, 1 Apr 2021 15:05:17 +0000 > Anatoly Burakov wrote: > >> + /* fgets puts null terminator in, but do this just in case */ >> + buf[BUFSIZ - 1] = '\0'; >> + >> + /* strip off any terminating newlines */ >> + if (strlen(buf)) >> + strtok(buf, "\n"); > > Why not the simpler/shorter > strchrnul(buf, '\n') = '\0'; > How many more string functions are there that i don't know about :D -- Thanks, Anatoly