From: Markus Elfring <Markus.Elfring@web.de>
To: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Jiri Kosina <jikos@kernel.org>
Subject: Re: [v2] HID: corsair-void: Add Corsair Void headset family driver
Date: Wed, 21 Aug 2024 09:26:35 +0200 [thread overview]
Message-ID: <f0aa2ca0-6256-48e4-8d2a-dfd5da072ad4@web.de> (raw)
In-Reply-To: <CALTg27nu2_26WwFKc2hWbWY9B40QQLxJ_bM97OWY9VoRo-d_FA@mail.gmail.com>
>> This was the case for a while.
>>
>> Increasing applications of scope-based resource management provide
>> further opportunities for smaller scopes according to some local variables,
>> don't they?
>
> Personally I'd rather it just fits in with the rest of the kernel,
> but if the general consensus is that new drivers should use tighter
> scopes, I can do that instead.
There are the usual communication challenges to consider also especially
with collateral evolution in such software areas.
>> How do you think about to collaborate with other data structures
>> than character arrays?
>>
>> See also:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.11-rc4#n953
>
> Hm, I picked a character array since all it's doing is sending a
> buffer to the device.
> There's no published specification to follow, only "Well the Windows
> driver sends these bytes and this happens".
> So there isn't really a structure that really comes naturally,
> especially with all the magic numbers.
I imagine that further development concerns can be adjusted accordingly.
> Unless you're suggesting I just do `unsigned char send_buf[3] = {...}`?
Such a programming approach might also look promising.
> I checked the docs, apparently I misread somewhere that
> `hid_hw_raw_request` couldn't use stack allocated memory safely,
> whoops.
Will safer API usage be clarified further?
Can applications of advanced data structures become more appealing?
Regards,
Markus
next prev parent reply other threads:[~2024-08-21 7:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-18 23:19 [PATCH v2] HID: corsair-void: Add Corsair Void headset family driver Stuart Hayhurst
2024-08-19 7:48 ` Markus Elfring
2024-08-20 0:21 ` Stuart
2024-08-20 5:56 ` [v2] " Markus Elfring
2024-08-21 0:52 ` Stuart
2024-08-21 7:26 ` Markus Elfring [this message]
2024-08-21 9:52 ` Christophe JAILLET
2024-08-22 1:11 ` Stuart
2024-08-22 6:15 ` Christophe JAILLET
2024-08-22 11:57 ` Jiri Kosina
2024-08-22 15:36 ` Stuart
2024-08-23 8:45 ` Markus Elfring
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=f0aa2ca0-6256-48e4-8d2a-dfd5da072ad4@web.de \
--to=markus.elfring@web.de \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stuart.a.hayhurst@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;
as well as URLs for NNTP newsgroup(s).