[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220620004233.3805-24-kent.overstreet@gmail.com>
Date: Sun, 19 Jun 2022 20:42:22 -0400
From: Kent Overstreet <kent.overstreet@...il.com>
To: linux-kernel@...r.kernel.org, linux-mm@...ck.org, pmladek@...e.com
Cc: Kent Overstreet <kent.overstreet@...il.com>, rostedt@...dmis.org,
enozhatsky@...omium.org, linux@...musvillemoes.dk,
willy@...radead.org
Subject: [PATCH v4 23/34] Input/joystick/analog: Convert from seq_buf -> printbuf
seq_buf is being deprecated, this converts to printbuf.
Signed-off-by: Kent Overstreet <kent.overstreet@...il.com>
---
drivers/input/joystick/analog.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 3088c5b829..a8c5f90e82 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -19,7 +19,7 @@
#include <linux/input.h>
#include <linux/gameport.h>
#include <linux/jiffies.h>
-#include <linux/seq_buf.h>
+#include <linux/printbuf.h>
#include <linux/timex.h>
#include <linux/timekeeping.h>
@@ -339,24 +339,21 @@ static void analog_calibrate_timer(struct analog_port *port)
static void analog_name(struct analog *analog)
{
- struct seq_buf s;
+ struct printbuf buf = PRINTBUF_EXTERN(analog->name, sizeof(analog->name));
- seq_buf_init(&s, analog->name, sizeof(analog->name));
- seq_buf_printf(&s, "Analog %d-axis %d-button",
- hweight8(analog->mask & ANALOG_AXES_STD),
- hweight8(analog->mask & ANALOG_BTNS_STD) + !!(analog->mask & ANALOG_BTNS_CHF) * 2 +
- hweight16(analog->mask & ANALOG_BTNS_GAMEPAD) + !!(analog->mask & ANALOG_HBTN_CHF) * 4);
+ prt_printf(&buf, "Analog %d-axis %d-button",
+ hweight8(analog->mask & ANALOG_AXES_STD),
+ hweight8(analog->mask & ANALOG_BTNS_STD) + !!(analog->mask & ANALOG_BTNS_CHF) * 2 +
+ hweight16(analog->mask & ANALOG_BTNS_GAMEPAD) + !!(analog->mask & ANALOG_HBTN_CHF) * 4);
if (analog->mask & ANALOG_HATS_ALL)
- seq_buf_printf(&s, " %d-hat",
- hweight16(analog->mask & ANALOG_HATS_ALL));
-
+ prt_printf(&buf, " %d-hat", hweight16(analog->mask & ANALOG_HATS_ALL));
if (analog->mask & ANALOG_HAT_FCS)
- seq_buf_printf(&s, " FCS");
+ prt_printf(&buf, " FCS");
if (analog->mask & ANALOG_ANY_CHF)
- seq_buf_printf(&s, (analog->mask & ANALOG_SAITEK) ? " Saitek" : " CHF");
+ prt_printf(&buf, (analog->mask & ANALOG_SAITEK) ? " Saitek" : " CHF");
- seq_buf_printf(&s, (analog->mask & ANALOG_GAMEPAD) ? " gamepad" : " joystick");
+ prt_printf(&buf, (analog->mask & ANALOG_GAMEPAD) ? " gamepad" : " joystick");
}
/*
--
2.36.1
Powered by blists - more mailing lists