mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Risheng1128 <hi4u29ck02@gmail.com>
To: srinivas.pandruvada@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, Risheng1128 <hi4u29ck02@gmail.com>
Subject: [PATCH] tools/power/x86/intel-speed-select: Remove duplicate macro
Date: Sat, 11 Jun 2022 01:27:14 +0800	[thread overview]
Message-ID: <20220610172714.27772-1-hi4u29ck02@gmail.com> (raw)

There are some macros such as `GENMASK` and `GENMASK_ULL` are redefined in
`include/linux/bits.h`. Simultaneously, the `GENMASK` in
`include/linux/bits.h` is more secure and prevents the following situation.
1. [net: stmmac: Fix misuses of GENMASK macro](https://reurl.cc/loMWvl)
2. [clocksource/drivers/npcm: Fix misuse of GENMASK macro](
https://reurl.cc/b2yr96)

Therefore, I think these macro could be removed.

Signed-off-by: Risheng1128 <hi4u29ck02@gmail.com>
---
 tools/power/x86/intel-speed-select/Makefile | 1 +
 tools/power/x86/intel-speed-select/isst.h   | 7 +------
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/power/x86/intel-speed-select/Makefile b/tools/power/x86/intel-speed-select/Makefile
index 7221f2f55e8b..760d49d61955 100644
--- a/tools/power/x86/intel-speed-select/Makefile
+++ b/tools/power/x86/intel-speed-select/Makefile
@@ -14,6 +14,7 @@ endif
 # (this improves performance and avoids hard-to-debug behaviour);
 MAKEFLAGS += -r
 override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3
+override CFLAGS += -I../../../include
 override LDFLAGS += -lnl-genl-3 -lnl-3
 
 ALL_TARGETS := intel-speed-select
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 0796d8c6a882..44de990d182e 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -27,12 +27,7 @@
 
 #include <stdarg.h>
 #include <sys/ioctl.h>
-
-#define BIT(x) (1 << (x))
-#define BIT_ULL(nr) (1ULL << (nr))
-#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))
-#define GENMASK_ULL(h, l)                                                      \
-	(((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))
+#include <linux/bits.h>
 
 #define CONFIG_TDP				0x7f
 #define CONFIG_TDP_GET_LEVELS_INFO		0x00
-- 
2.25.1


             reply	other threads:[~2022-06-10 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 17:27 Risheng1128 [this message]
2022-06-22 10:02 ` Hans de Goede
2022-09-14 18:49 ` srinivas pandruvada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220610172714.27772-1-hi4u29ck02@gmail.com \
    --to=hi4u29ck02@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®