Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4653870ooa; Tue, 14 Aug 2018 08:46:34 -0700 (PDT) X-Google-Smtp-Source: AA+uWPynsGoEGfuZax9/ym8HPKtP9Bfod8vG/TxnK96WF+MdZol2JfGBtaffexZo7rJsIYYzDIqW X-Received: by 2002:a63:dc53:: with SMTP id f19-v6mr21726251pgj.56.1534261594863; Tue, 14 Aug 2018 08:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534261594; cv=none; d=google.com; s=arc-20160816; b=AsHbIEJaakSSw4zxUVbkx1Q7xFafDoqWxFZXqZOgZ9t/Tw7AhQDoX3htNRld/BCA2T H/XrFwa0s1e4t3gRca16OlJuTKyOoUJ8FQpqTAxyCDndCMpnzh7+JGqb6xgqJW7XCQrJ GMgMQuusodhdFfhDqlBrKecKPOHS7urpvY9B42NnPT7Lwpnwe+EPIVCE72dTcCpUFT/d Swh+ZFQDMeA0Xln5R27h0aZPiJJ3Z75hJrQoPndQ1b3XpLgAyCT0R6C6RJaZrVXUFRTi t2eFea6rFeJT24mAZAeZ0yVN/3drdFEI7THQcpoqMYTo1HNvs0LQBSYwLb/b/6vtti9o odrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=y+HPs4IpRbxC83R2gfLwqQC/RQ2bHJTXtQlsCtr3KVo=; b=Rmsku4+JoCrTwttQwJkA2ijv80wrhEp2YW0DWECDt7g3OI3NcV9d+yVB6fG7ALDKSE 9teOJK8HoSfLfunb9TmvRjvikzUycdcpT7IB9hdK2Kl2XjpPr+m/k5fckKXi96jNwsQB uE23J0E45fkwZa+CEwycqrXnk51AeKlFo0p7WX8Bry9GvkT+EA5Fs+cFDiTyj+LR4cYB xrntIj7fU4yBIgLhOqKvtjDnPJYLdfXy2sWs8gH+/PVBVakytqmXnC6My/2XM3njLmp4 X6sKLQzpICm9SOHxALO30erjSjWerB3NN7q6vNBVjUID1/K2YxOz63/j/KoEtOMCAF2t O3/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+PVmOvX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c192-v6si20919256pfg.347.2018.08.14.08.46.19; Tue, 14 Aug 2018 08:46:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+PVmOvX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732686AbeHNScq (ORCPT + 99 others); Tue, 14 Aug 2018 14:32:46 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33187 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732650AbeHNScq (ORCPT ); Tue, 14 Aug 2018 14:32:46 -0400 Received: by mail-lj1-f193.google.com with SMTP id s12-v6so15763161ljj.0 for ; Tue, 14 Aug 2018 08:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=y+HPs4IpRbxC83R2gfLwqQC/RQ2bHJTXtQlsCtr3KVo=; b=H+PVmOvXCPTnRuplwC3bEWMhTpmaOulDVzH30R6G3x4XDxEv+LbAByU/YfgXQLnM2x 7teiPFGIy4FCTGbvZYr9ua82NJlxjeh31Wg/xU8jmdA2FkTZggBvAmu8tQPOrTehaKK+ JMh0LjFosXQYyIsRlJiW+tE+guOxAMI2pk2NI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=y+HPs4IpRbxC83R2gfLwqQC/RQ2bHJTXtQlsCtr3KVo=; b=aafObak9GDtTi/6uW0C3abRIxOpK9ardRP+3ALI7tamk0gPlb/5VYPPO1xec75fdlK s+Gh/+TuhiGXFXolJqDhFvnwT4MtlXtr+4SYOVNe3qSL6eYXvArmQUWjBIc518klr8Qr 63J9Q350lAcb5/bJ2f0JavNsbZmx+Se/gCDs+LxSD2T4aVrEYFXm6wQ8yyEIjKyAVvvG g6aWc+JMdh1SEea+E+fUutqF4rcKQcKcRuiGchhL0suJIhjXxDGPpvslj6pzEeRCatOg NYg+Ji+gwCwiXIMsATQXcHaxOCqrOXTcrK2M3ILROqzC9n67I49C9Z56sbZkTDLZJGSL eVqA== X-Gm-Message-State: AOUpUlG6AHlICayJ+uGWJEk482rtuqLSOkGU6xtm/Tjg2ZpXHBkeUDl7 fB0ljibnzDjWPXFzqDRaR4cPiMLv0ryyuDSI8IZxBQ== X-Received: by 2002:a2e:4103:: with SMTP id o3-v6mr15184908lja.3.1534261502980; Tue, 14 Aug 2018 08:45:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:140c:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 08:45:02 -0700 (PDT) In-Reply-To: <1531445169-19912-1-git-send-email-asmadeus@codewreck.org> References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <1531445169-19912-1-git-send-email-asmadeus@codewreck.org> From: =?UTF-8?B?RGFuaWVsIETDrWF6?= Date: Tue, 14 Aug 2018 10:45:02 -0500 Message-ID: Subject: Re: [PATCH 18/18] cpupower: change strncpy+truncation to strlcpy To: Dominique Martinet Cc: Thomas Renninger , Shuah Khan , Colin Ian King , linux-pm@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 12 July 2018 at 20:26, Dominique Martinet wrote= : > Generated by scripts/coccinelle/misc/strncpy_truncation.cocci > > Signed-off-by: Dominique Martinet > --- > > Please see https://marc.info/?l=3Dlinux-kernel&m=3D153144450722324&w=3D2 = (the > first patch of the serie) for the motivation behind this patch > > tools/power/cpupower/bench/parse.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/be= nch/parse.c > index 9ba8a44ad2a7..1566b89989b2 100644 > --- a/tools/power/cpupower/bench/parse.c > +++ b/tools/power/cpupower/bench/parse.c > @@ -221,9 +221,8 @@ int prepare_config(const char *path, struct config *c= onfig) > sscanf(val, "%u", &config->cpu); > > else if (strcmp("governor", opt) =3D=3D 0) { > - strncpy(config->governor, val, > + strlcpy(config->governor, val, > sizeof(config->governor)); > - config->governor[sizeof(config->governor) - 1] = =3D '\0'; > } > > else if (strcmp("priority", opt) =3D=3D 0) { > -- > 2.17.1 I can't get cpupower to compile anymore now that it made its way to linux-n= ext: [/linux/tools/power/cpupower]$ make CC lib/cpufreq.o [...] make[1]: Entering directory '/linux/tools/power/cpupower/bench' CC main.o CC parse.o parse.c: In function =E2=80=98prepare_config=E2=80=99: parse.c:224:4: warning: implicit declaration of function =E2=80=98strlcpy= =E2=80=99 [-Wimplicit-function-declaration] strlcpy(config->governor, val, ^ CC system.o CC benchmark.o CC cpufreq-bench .//parse.o: In function `prepare_config': /linux/tools/power/cpupower/bench/parse.c:224: undefined reference to `strlcpy' collect2: error: ld returned 1 exit status Makefile:25: recipe for target 'cpufreq-bench' failed make[1]: *** [cpufreq-bench] Error 1 make[1]: Leaving directory '/linux/tools/power/cpupower/bench' Makefile:258: recipe for target 'compile-bench' failed make: *** [compile-bench] Error 2 Does it need anything special to make? Greetings! Daniel D=C3=ADaz daniel.diaz@linaro.org