From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: atkbd - simplify atkbd_show_force_release()
Date: Mon, 26 Apr 2021 09:06:48 +0200 [thread overview]
Message-ID: <7df61d10-6391-f64c-e54d-cb2022b71902@prevas.dk> (raw)
In-Reply-To: <YITTkui8qer2S+4R@google.com>
On 25/04/2021 04.27, Dmitry Torokhov wrote:
> Hi Rasmus,
>
> On Wed, Apr 21, 2021 at 10:16:39PM +0200, Rasmus Villemoes wrote:
>> We can just include the newline in the format string, and scnprintf()
>> guarantees nul-termination. These days, sysfs_emit() is
>> preferred in sysfs ->show methods, so switch to that.
>
> Technically speaking the conversion is not 100% equivalent - original
> code ensured that there is always a newline in the output. I kind of
> like this, so maybe we need sysfs_emit_nl() or similar?
(1) From a UX perspective, it actually seems better to have lack of
trailing newline as a (though subtle) indicator that the output was
truncated
(2) Given that ATKBD_KEYMAP_SIZE is 512, I don't see how that could
actually ever happen. AFAICT, the worst case %pbl representation is when
the bitmap consists of a series two set bits and one unset bit, yielding
a pattern of "xxx-yyy," (with yyy=xxx+1) for 8 characters per 3 bits, or
about 1365 characters (slight overestimate because of one- and two-digit
numbers).
prev parent reply other threads:[~2021-04-26 7:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 20:16 [PATCH] Input: atkbd - simplify atkbd_show_force_release() Rasmus Villemoes
2021-04-25 2:27 ` Dmitry Torokhov
2021-04-26 7:06 ` Rasmus Villemoes [this message]
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=7df61d10-6391-f64c-e54d-cb2022b71902@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/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 NNTP newsgroup(s).