lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzICCqPw4lDY+oZi@kernel.org>
Date:   Mon, 26 Sep 2022 20:48:26 +0100
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Chen Zhongjin <chenzhongjin@...wei.com>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        peterz@...radead.org, mingo@...hat.com, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        namhyung@...nel.org, irogers@...gle.com, john.garry@...wei.com,
        adrian.hunter@...el.com, ak@...ux.intel.com,
        florian.fischer@...q.space
Subject: Re: [PATCH -next 4/5] perf: Remove unused macros __PERF_EVENT_FIELD

Em Mon, Sep 26, 2022 at 11:14:39AM +0800, Chen Zhongjin escreveu:
> Unused macros reported by [-Wunused-macros].
> 
> This macros were introduced as __PERF_COUNTER_FIELD and used for
> reading the bit in config.
> 
> 'cdd6c482c9ff ("perf: Do the big rename: Performance Counters -> Performance Events")'
> Changes it to __PERF_EVENT_FIELD but at this commit there is already
> nowhere else using these macros, also no macros called
> PERF_EVENT_##name##_MASK/SHIFT.
> 
> Now we are not reading type or id from config. These macros are
> useless and incomplete.
> 
> So removing them for code cleaning.

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
> ---
>  tools/perf/util/parse-events.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index f05e15acd33f..3ed914882b96 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -149,14 +149,6 @@ struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = {
>  	},
>  };
>  
> -#define __PERF_EVENT_FIELD(config, name) \
> -	((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)
> -
> -#define PERF_EVENT_RAW(config)		__PERF_EVENT_FIELD(config, RAW)
> -#define PERF_EVENT_CONFIG(config)	__PERF_EVENT_FIELD(config, CONFIG)
> -#define PERF_EVENT_TYPE(config)		__PERF_EVENT_FIELD(config, TYPE)
> -#define PERF_EVENT_ID(config)		__PERF_EVENT_FIELD(config, EVENT)
> -
>  const char *event_type(int type)
>  {
>  	switch (type) {
> -- 
> 2.17.1

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ