The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: jikos@kernel.org
Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH for-5.19/uclogic 1/4] HID: uclogic: Compress params format string
Date: Thu, 14 Apr 2022 13:09:33 +0200	[thread overview]
Message-ID: <20220414110936.146378-2-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20220414110936.146378-1-jose.exposito89@gmail.com>

From: Nikolai Kondrashov <spbnick@gmail.com>

Shorten the format string for printing out UC-Logic interface parameters
so that it fits into a single log message.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/hid/hid-uclogic-params.h | 90 ++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 39 deletions(-)

diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h
index f2649e8f959d..ebf84b56746b 100644
--- a/drivers/hid/hid-uclogic-params.h
+++ b/drivers/hid/hid-uclogic-params.h
@@ -203,45 +203,57 @@ extern int uclogic_params_init(struct uclogic_params *params,
 
 /* Tablet interface parameters *printf format string */
 #define UCLOGIC_PARAMS_FMT_STR \
-		".invalid = %s\n"                               \
-		".desc_ptr = %p\n"                              \
-		".desc_size = %u\n"                             \
-		".pen.desc_ptr = %p\n"                          \
-		".pen.desc_size = %u\n"                         \
-		".pen.id = %u\n"                                \
-		".pen.subreport_list[0] = {0x%02hhx, %hhu}\n"   \
-		".pen.subreport_list[1] = {0x%02hhx, %hhu}\n"   \
-		".pen.subreport_list[2] = {0x%02hhx, %hhu}\n"   \
-		".pen.inrange = %s\n"                           \
-		".pen.fragmented_hires = %s\n"                  \
-		".pen.tilt_y_flipped = %s\n"                    \
-		".frame_list[0].desc_ptr = %p\n"                \
-		".frame_list[0].desc_size = %u\n"               \
-		".frame_list[0].id = %u\n"                      \
-		".frame_list[0].suffix = %s\n"                  \
-		".frame_list[0].re_lsb = %u\n"                  \
-		".frame_list[0].dev_id_byte = %u\n"             \
-		".frame_list[0].touch_ring_byte = %u\n"         \
-		".frame_list[0].touch_ring_max = %hhd\n"        \
-		".frame_list[0].touch_ring_flip_at = %hhd\n"    \
-		".frame_list[1].desc_ptr = %p\n"                \
-		".frame_list[1].desc_size = %u\n"               \
-		".frame_list[1].id = %u\n"                      \
-		".frame_list[1].suffix = %s\n"                  \
-		".frame_list[1].re_lsb = %u\n"                  \
-		".frame_list[1].dev_id_byte = %u\n"             \
-		".frame_list[1].touch_ring_byte = %u\n"         \
-		".frame_list[1].touch_ring_max = %hhd\n"        \
-		".frame_list[1].touch_ring_flip_at = %hhd\n"    \
-		".frame_list[2].desc_ptr = %p\n"                \
-		".frame_list[2].desc_size = %u\n"               \
-		".frame_list[2].id = %u\n"                      \
-		".frame_list[2].suffix = %s\n"                  \
-		".frame_list[2].re_lsb = %u\n"                  \
-		".frame_list[2].dev_id_byte = %u\n"             \
-		".frame_list[2].touch_ring_byte = %u\n"         \
-		".frame_list[2].touch_ring_max = %hhd\n"        \
-		".frame_list[2].touch_ring_flip_at = %hhd\n"
+		".invalid = %s\n"                   \
+		".desc_ptr = %p\n"                  \
+		".desc_size = %u\n"                 \
+		".pen = {\n"                        \
+		"\t.desc_ptr = %p\n"                \
+		"\t.desc_size = %u\n"               \
+		"\t.id = %u\n"                      \
+		"\t.subreport_list = {\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t}\n"                             \
+		"\t.inrange = %s\n"                 \
+		"\t.fragmented_hires = %s\n"        \
+		"\t.tilt_y_flipped = %s\n"          \
+		"}\n"                               \
+		".frame_list = {\n"                 \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"}\n"
 
 /* Tablet interface parameters *printf format arguments */
 #define UCLOGIC_PARAMS_FMT_ARGS(_params) \
-- 
2.25.1


  reply	other threads:[~2022-04-14 11:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 11:09 [PATCH for-5.19/uclogic 0/4] DIGImend patches, part IV José Expósito
2022-04-14 11:09 ` José Expósito [this message]
2022-04-14 11:09 ` [PATCH for-5.19/uclogic 2/4] HID: uclogic: Reduce indent for params format str/args José Expósito
2022-04-14 11:09 ` [PATCH for-5.19/uclogic 3/4] HID: uclogic: Add support for bitmap dials José Expósito
2022-04-14 11:09 ` [PATCH for-5.19/uclogic 4/4] HID: uclogic: Add support for Huion Q620M José Expósito
2022-04-21  8:09 ` [PATCH for-5.19/uclogic 0/4] DIGImend patches, part IV Jiri Kosina

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=20220414110936.146378-2-jose.exposito89@gmail.com \
    --to=jose.exposito89@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spbnick@gmail.com \
    /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