diff mbox

[v2,11/17] drivers/input/gameport: Replace rdtscl() with native_read_tsc()

Message ID 1937af4905bc041d07d05bc51bca983a60df2c6c.1434152603.git.luto@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Lutomirski June 12, 2015, 11:44 p.m. UTC
It's unclear to me why this code exists in the first place.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/input/gameport/gameport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dmitry Torokhov June 16, 2015, 11:04 p.m. UTC | #1
On Fri, Jun 12, 2015 at 04:44:51PM -0700, Andy Lutomirski wrote:
> It's unclear to me why this code exists in the first place.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Andy Lutomirski <luto@kernel.org>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/input/gameport/gameport.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
> index e853a2134680..abc0cb22e750 100644
> --- a/drivers/input/gameport/gameport.c
> +++ b/drivers/input/gameport/gameport.c
> @@ -149,9 +149,9 @@ static int old_gameport_measure_speed(struct gameport *gameport)
>  
>  	for(i = 0; i < 50; i++) {
>  		local_irq_save(flags);
> -		rdtscl(t1);
> +		t1 = native_read_tsc();
>  		for (t = 0; t < 50; t++) gameport_read(gameport);
> -		rdtscl(t2);
> +		t2 = native_read_tsc();
>  		local_irq_restore(flags);
>  		udelay(i * 10);
>  		if (t2 - t1 < tx) tx = t2 - t1;
> -- 
> 2.4.2
>
diff mbox

Patch

diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index e853a2134680..abc0cb22e750 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -149,9 +149,9 @@  static int old_gameport_measure_speed(struct gameport *gameport)
 
 	for(i = 0; i < 50; i++) {
 		local_irq_save(flags);
-		rdtscl(t1);
+		t1 = native_read_tsc();
 		for (t = 0; t < 50; t++) gameport_read(gameport);
-		rdtscl(t2);
+		t2 = native_read_tsc();
 		local_irq_restore(flags);
 		udelay(i * 10);
 		if (t2 - t1 < tx) tx = t2 - t1;