From: Jeff LaBundy <jeff@labundy.com>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: "Anshul Dalal" <anshulusr@gmail.com>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] input: joystick: driver for Adafruit Seesaw Gamepad
Date: Mon, 23 Oct 2023 16:24:38 -0500 [thread overview]
Message-ID: <ZTbklpRhpMIPey2j@nixie71> (raw)
In-Reply-To: <00d2fcbc-3fd8-477d-8df1-afec20b458b6@t-8ch.de>
Hi Thomas,
On Mon, Oct 23, 2023 at 07:55:52AM +0200, Thomas Weißschuh wrote:
[...]
> >> + err = i2c_master_send(client, write_buf, sizeof(write_buf));
> >> + if (err < 0)
> >> + return err;
> >
> > You correctly return err (or rather, ret) for negative values, but you should also
> > check that ret matches the size of the data sent. For 0 <= ret < sizeof(writebuf),
> > return -EIO.
>
> The driver did this originally.
> I then requested it to be removed as this case
> can never happen.
> i2c_master_send will either return size of(writebuf) or an error.
Great catch; indeed you are correct. Apologies for having missed this
in the change log; this is good to know in the future.
That being said, it's a moot point IMO; this driver seems like a good
candidate for regmap. If regmap cannot be made to work here for some
reason, then I'd like to at least see some wrapper functions to avoid
duplicate code and manual assignments to a buffer.
Kind regards,
Jeff LaBundy
next prev parent reply other threads:[~2023-10-23 21:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 3:43 [PATCH v5 1/2] dt-bindings: input: bindings for Adafruit Seesaw Gamepad Anshul Dalal
2023-10-17 3:43 ` [PATCH v5 2/2] input: joystick: driver " Anshul Dalal
2023-10-19 0:10 ` kernel test robot
2023-10-22 23:42 ` Jeff LaBundy
2023-10-23 5:55 ` Thomas Weißschuh
2023-10-23 21:24 ` Jeff LaBundy [this message]
2023-10-24 15:56 ` Thomas Weißschuh
2023-10-25 10:20 ` Anshul Dalal
2023-10-26 4:38 ` Jeff LaBundy
2023-10-22 23:47 ` [PATCH v5 1/2] dt-bindings: input: bindings " Jeff LaBundy
2023-10-23 11:58 ` Anshul Dalal
2023-10-23 18:53 ` Jeff LaBundy
-- strict thread matches above, loose matches on Subject: below --
2023-10-12 16:27 Anshul Dalal
2023-10-12 16:27 ` [PATCH v5 2/2] input: joystick: driver " Anshul Dalal
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=ZTbklpRhpMIPey2j@nixie71 \
--to=jeff@labundy.com \
--cc=anshulusr@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=robh+dt@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=thomas@t-8ch.de \
/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).