From patchwork Mon Jun 20 00:42:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 12886915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E529C43334 for ; Mon, 20 Jun 2022 00:43:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C66B26B0072; Sun, 19 Jun 2022 20:43:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C15A76B0087; Sun, 19 Jun 2022 20:43:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B04B16B0088; Sun, 19 Jun 2022 20:43:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A6D6D6B0072 for ; Sun, 19 Jun 2022 20:43:29 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 89C05603D8 for ; Mon, 20 Jun 2022 00:43:29 +0000 (UTC) X-FDA: 79596765738.27.8E309FF Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf09.hostedemail.com (Postfix) with ESMTP id 359BE140019 for ; Mon, 20 Jun 2022 00:43:29 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id x75so6867645qkb.12 for ; Sun, 19 Jun 2022 17:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oHZ6nQT/N9bLil/etCt1wSEx4xhnhUtuxCNLNmvznXY=; b=S9XptWh8DqC+66cgLZqvqnxt6sGYteRfU4WLgKm4FNZ10hcJXl3XfADdQTOVFiFzSz g2sKvhZHX5aF0c6SSfjPkhOt3+ZQmjDPvT6/7sEIBw7MBAy0F1W+LYUZXPDTAL+E6//y N47O9ZxAj/+D0i5xhCQeW9QoS9wbJmSXkIk4TedVlQepn6nf4x7bG/IaN6GWv+v+5Ot2 jTSYwCujqxHC4+Ln4Uyecczl4f/4FsdrMtsZAiv/Mfp0wTEH2BkwUpT904cAi2PMzd4+ j5RHs9XmNNnMrGU/lRUtAkx/NPoQdv7d9u63cb33KjqgG7qqkvQFaGNkqs/98/s04ZUs ZEvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oHZ6nQT/N9bLil/etCt1wSEx4xhnhUtuxCNLNmvznXY=; b=Rs1sVQPP9Fn2sn8lKzT2oYI1wE8GdLMqxTEoAUGeU5A0HUh/yXX0i9xkZJIv65sUcV 2PKwRDVBudrm5FNgKgkXG9HKysg1bPn0flLcXe1Rty6zYJs/iHDAi3si7OxN5/mgN5M9 8JiOyo0o5TFrwQ15S6/etPsQczgO8wAv+JabAAxFoGGsRFsOFzlyvpBqSAq3lFaB44s/ F3RcDWN0X2cY6NcBwp60tgWVWa4VBVjquayCSZnwRjnAWcWCqtyV3dxTSw4pIhu1SBzC OgbPKKa666F2CUSd5X1lpKm2ovIQI739UywhoznCk8r97Tk5qbwYZM3/LcId/iuQYLTJ O3eA== X-Gm-Message-State: AJIora+WFGn0gRjKZnKn9Vmk2Uvtot1TxfYWLp5iUOv4zcBZj9kwY9vo zBkxBIeaaUzcmcflpVytCg== X-Google-Smtp-Source: AGRyM1skuA5LbWzNEHZ7Lk4CN7aJYyltI0ZJ+LVvNJE8kd9aywds6JcebeSrNRYxQ5JcxvYG8liLvw== X-Received: by 2002:a05:620a:130d:b0:6a6:bb03:d8ab with SMTP id o13-20020a05620a130d00b006a6bb03d8abmr14522452qkj.133.1655685808583; Sun, 19 Jun 2022 17:43:28 -0700 (PDT) Received: from localhost (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id l27-20020ac84cdb000000b003051ea4e7f6sm9828308qtv.48.2022.06.19.17.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 17:43:27 -0700 (PDT) From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, pmladek@suse.com Cc: Kent Overstreet , rostedt@goodmis.org, enozhatsky@chromium.org, linux@rasmusvillemoes.dk, willy@infradead.org Subject: [PATCH v4 23/34] Input/joystick/analog: Convert from seq_buf -> printbuf Date: Sun, 19 Jun 2022 20:42:22 -0400 Message-Id: <20220620004233.3805-24-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620004233.3805-1-kent.overstreet@gmail.com> References: <20220620004233.3805-1-kent.overstreet@gmail.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655685809; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oHZ6nQT/N9bLil/etCt1wSEx4xhnhUtuxCNLNmvznXY=; b=v0vl646TqOmsXSiIX6ERU7iE+OtaqKQKtuCMomxsKFKaVXjG95Fq3VScuonswbDGhbynvC Uwr3dEvooO6kqdfJ+PtmM6gS40I1xqv9ds8ac4oUPKFCZISXCiHir59ZEBH6X0kPAlzGv+ mR3Ik1xborB/GJSMr+oF/rYBOYvlqeo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655685809; a=rsa-sha256; cv=none; b=xaUAQpuLSbKmp+aG08Nb0spGPEKOFxhtm+wWltKwZ61Sx60TgoxAp66ScXCG0ycgauGbaT tvFmRFyMAezLw5lPD33Ufv/jBHksR5aasUqD7+Wgd/NCWLFNtt8ViRkaqaA56hynqovRZB fOYP6eP+KUjvr6X/618ossOOb3iiJbM= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=S9XptWh8; spf=pass (imf09.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: bmxbpo7bsdh6pbdr35oaqex763cgmk88 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=S9XptWh8; spf=pass (imf09.hostedemail.com: domain of kent.overstreet@gmail.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Queue-Id: 359BE140019 X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1655685809-83647 X-Bogosity: Ham, tests=bogofilter, spamicity=0.012214, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: seq_buf is being deprecated, this converts to printbuf. Signed-off-by: Kent Overstreet --- 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 #include #include -#include +#include #include #include @@ -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"); } /*