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 D298EA0548; Fri, 2 Apr 2021 19:46:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA15C141149; Fri, 2 Apr 2021 19:46:46 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 5581B141143 for ; Fri, 2 Apr 2021 19:46:46 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id e14so2822035plj.2 for ; Fri, 02 Apr 2021 10:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xNe8GA4i3AXUJC5+H0dX49jcU6pR+V3yy7vVs3/XvM4=; b=1/OIBS6ZxJiBvS5dOlrN3l1Y9jTsmKFo3y9QtfYwFTRIgegk0IXt8LDpZfuoS2ZJoY Dkc3hJtkmZwfNxaUSLbQrNf3B7ilzIyKAwe2usOhVBJi/MCLTOMGOJ2yu2RHFKT1PAn/ SuLez3z8sXWjBHVlDbjmSnpjiCEMASmw8qf7gAR/JDH13aB/AAInonN1bQEK5bohLOY2 e1GQCT9SqyEaL7WbEkisJpnFWMbZTI8PfjsqknGJJvFbBMSxfV5DNhMTZjzAJODu/FBs B1zWGFj9h+fzEaOWi1ylBUC5qdJ9p2eWNL9nHKDVjCEyJ+hPLPIQ3eUrhgI3MMQDXMoJ B9TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xNe8GA4i3AXUJC5+H0dX49jcU6pR+V3yy7vVs3/XvM4=; b=awiX/Y+//dIrWfI34GK9BSrexIQQzqr8SrvZeiKtG7K+JbMgWFZWPJub6Qul5AQ3dN 9NyXAnu6Ey7gMPb7waiWo6QNuBrMpp/nbeZ353BlMX1rLOEb7UN4qzYBsNPypKi4gjV5 ZvgY3SB8suHOFbSoROEKKsnahOFbbwKTjbMwj2ljN8N/G4TUvu9PGpUvz2xUPks5OOcU +HH4uwVtraNEDFZu6OB8wJIOB6Jn4ASc298yMQpnrWcq671ZpXfxGbTnckgHEzn4wdsX KMbO2Dy4ITglayCaLMj5K7XTfmILHOEsSTk5Fm8wFYer8z8NPaJU9wMY2I73I0F34L5k 3V9A== X-Gm-Message-State: AOAM533RfKXuRVi8yI6O0HASJZnY1VTDLGrU3wr7U/+I4kHBA0YIQbHC vedQWj8MpfV6dphStsDSzgLzOg== X-Google-Smtp-Source: ABdhPJzXL3BFMqgfkBHlLpPcl9GUxI/oHYljCZkM46Mhb0iwZXdd8rgrkxEaib07w4ggrv0lCoq5lA== X-Received: by 2002:a17:902:7792:b029:e6:caba:f836 with SMTP id o18-20020a1709027792b02900e6cabaf836mr13589192pll.41.1617385605508; Fri, 02 Apr 2021 10:46:45 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id w191sm9415498pfd.25.2021.04.02.10.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 10:46:45 -0700 (PDT) Date: Fri, 2 Apr 2021 10:46:42 -0700 From: Stephen Hemminger To: Anatoly Burakov Cc: dev@dpdk.org Message-ID: <20210402104642.29f22bba@hermes.local> In-Reply-To: <20210401150517.234085-1-anatoly.burakov@intel.com> References: <20210401150517.234085-1-anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 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';