From: Borislav Petkov <bp@alien8.de>
To: Thomas Sailer <t.sailer@alumni.ethz.ch>
Cc: linux-hams@vger.kernel.org, netdev@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc()
Date: Sun, 18 Dec 2022 13:04:05 +0100 [thread overview]
Message-ID: <20221218120405.2431-1-bp@alien8.de> (raw)
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(-)
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)
{
--
2.35.1
next reply other threads:[~2022-12-18 12:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-18 12:04 Borislav Petkov [this message]
2022-12-19 9:50 ` [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc() patchwork-bot+netdevbpf
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=20221218120405.2431-1-bp@alien8.de \
--to=bp@alien8.de \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=t.sailer@alumni.ethz.ch \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).