diff mbox series

hamradio: baycom_epp: Do not use x86-specific rdtsc()

Message ID 20221218120405.2431-1-bp@alien8.de (mailing list archive)
State Accepted
Commit aba5b397cad7d398b385aaf5029f99f41b690466
Delegated to: Netdev Maintainers
Headers show
Series hamradio: baycom_epp: Do not use x86-specific rdtsc() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: edumazet@google.com davem@davemloft.net pabeni@redhat.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Borislav Petkov Dec. 18, 2022, 12:04 p.m. UTC
From: "Borislav Petkov (AMD)" <bp@alien8.de>

Use get_cycles() which is provided by pretty much every arch.

The UML build works too because get_cycles() is a simple "return 0;"
because the rdtsc() is optimized away there.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
 drivers/net/hamradio/baycom_epp.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 19, 2022, 9:50 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Sun, 18 Dec 2022 13:04:05 +0100 you wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
> 
> Use get_cycles() which is provided by pretty much every arch.
> 
> The UML build works too because get_cycles() is a simple "return 0;"
> because the rdtsc() is optimized away there.
> 
> [...]

Here is the summary with links:
  - hamradio: baycom_epp: Do not use x86-specific rdtsc()
    https://git.kernel.org/netdev/net-next/c/aba5b397cad7

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index bd3b0c2655a2..83ff882f5d97 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -623,16 +623,10 @@  static int receive(struct net_device *dev, int cnt)
 
 /* --------------------------------------------------------------------- */
 
-#if defined(__i386__) && !defined(CONFIG_UML)
-#include <asm/msr.h>
 #define GETTICK(x)						\
 ({								\
-	if (boot_cpu_has(X86_FEATURE_TSC))			\
-		x = (unsigned int)rdtsc();			\
+	x = (unsigned int)get_cycles();				\
 })
-#else /* __i386__  && !CONFIG_UML */
-#define GETTICK(x)
-#endif /* __i386__  && !CONFIG_UML */
 
 static void epp_bh(struct work_struct *work)
 {