From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbdBAOm2 (ORCPT ); Wed, 1 Feb 2017 09:42:28 -0500 Received: from terminus.zytor.com ([65.50.211.136]:48280 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbdBAOm0 (ORCPT ); Wed, 1 Feb 2017 09:42:26 -0500 Date: Wed, 1 Feb 2017 06:41:48 -0800 From: tip-bot for Joe Stringer Message-ID: Cc: ast@fb.com, daniel@iogearbox.net, tglx@linutronix.de, joe@ovn.org, hpa@zytor.com, mingo@kernel.org, acme@redhat.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org Reply-To: daniel@iogearbox.net, tglx@linutronix.de, joe@ovn.org, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, wangnan0@huawei.com, ast@fb.com In-Reply-To: <20170126212001.14103-5-joe@ovn.org> References: <20170126212001.14103-5-joe@ovn.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools perf util: Make rm_rf(path) argument const Git-Commit-ID: 9a9c733d68c5cb89bd5c5ab91b9821e1a5d69272 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9a9c733d68c5cb89bd5c5ab91b9821e1a5d69272 Gitweb: http://git.kernel.org/tip/9a9c733d68c5cb89bd5c5ab91b9821e1a5d69272 Author: Joe Stringer AuthorDate: Thu, 26 Jan 2017 13:19:59 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jan 2017 16:20:07 -0300 tools perf util: Make rm_rf(path) argument const rm_rf() doesn't modify its path argument, and a future caller will pass a string constant into it to delete. Signed-off-by: Joe Stringer Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Wang Nan Cc: netdev@vger.kernel.org Link: http://lkml.kernel.org/r/20170126212001.14103-5-joe@ovn.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/util.c | 2 +- tools/perf/util/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index bf29aed..d8b45ce 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -85,7 +85,7 @@ int mkdir_p(char *path, mode_t mode) return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0; } -int rm_rf(char *path) +int rm_rf(const char *path) { DIR *dir; int ret = 0; diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 6e8be17..c74708d 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -209,7 +209,7 @@ static inline int sane_case(int x, int high) } int mkdir_p(char *path, mode_t mode); -int rm_rf(char *path); +int rm_rf(const char *path); struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *)); bool lsdir_no_dot_filter(const char *name, struct dirent *d); int copyfile(const char *from, const char *to);