All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/3] HID: steam: add serial number information.
Date: Tue, 20 Feb 2018 18:45:40 +0100	[thread overview]
Message-ID: <20180220174540.GA8231@casa> (raw)
In-Reply-To: <CAO-hwJ+MW=3X=pSrmPf=Xp7fW0X4d2GJJj_0rf0yCTmFsnfD1g@mail.gmail.com>

On Tue, Feb 20, 2018 at 05:49:02PM +0100, Benjamin Tissoires wrote:
> On Fri, Feb 16, 2018 at 9:59 PM, Rodrigo Rivas Costa
> > But about that +7 in hid_alloc_report_buf(), isn't it to make room for
> > the implement()/extract() functions? And IIUIC those are not used for
> > raw_requests... they are instead passed directly to usb_control_msg()
> > (or whatever the ll driver does). That's the point of being raw, isn't
> > it?
> >
> > If I'm right with that, would it make sense to go back to kzalloc(65)?
> >
> > If I'm wrong, then if you agree, I'll default to:
> >
> >         hid_hw_raw_request(steam->hid_dev, 0x00,
> >                 buf, hid_report_len(r) + 1, /* count the request number */
> >                 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
> >
> > Then, if hid_report_len() is ever updated to return the +1, this one
> > should be removed. And even if it is not, we still have +6 extra bytes
> > from hid_alloc_report_buf(), so no real harm done.
> 
> I am fine with your analysis except for the last point :)
> We need all 7 extra bytes, not 6 (in implement()). However, as you
> said, implement() is not used in the low_level transport functions, so
> there is no point bike shedding for ages.
> 
> I'd say please stick to hid_report_alloc_buf (maybe add a comment
> about the missing report ID added by usb), and use hid_report_len(r) +
> 1 while calling hid_hw_raw_request(). This way, we can always fix the
> behavior later and have something which will not break.
> 
> How does that sound?
It sound fine to me. I'll try to write a small comment explaining the
+1.

Thanks
Rodrigo

  reply	other threads:[~2018-02-20 17:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 12:03 [PATCH 1/3] HID: add driver for Valve Steam Controller Rodrigo Rivas Costa
2018-02-13 12:03 ` [PATCH 2/3] HID: steam: add serial number information Rodrigo Rivas Costa
2018-02-14 14:51   ` Benjamin Tissoires
2018-02-15 22:16     ` Rodrigo Rivas Costa
2018-02-16  8:44       ` Benjamin Tissoires
2018-02-16  9:02         ` Rodrigo Rivas Costa
2018-02-16  9:31           ` Benjamin Tissoires
2018-02-16  9:57             ` Rodrigo Rivas Costa
2018-02-16 10:38               ` Benjamin Tissoires
2018-02-16 20:59                 ` Rodrigo Rivas Costa
2018-02-20 16:49                   ` Benjamin Tissoires
2018-02-20 17:45                     ` Rodrigo Rivas Costa [this message]
2018-02-13 12:03 ` [PATCH 3/3] HID: steam: add battery device Rodrigo Rivas Costa
2018-02-14 14:54   ` Benjamin Tissoires
2018-02-14 14:45 ` [PATCH 1/3] HID: add driver for Valve Steam Controller Benjamin Tissoires
2018-02-14 21:28   ` Philippe Ombredanne
2018-02-14 23:29   ` Rodrigo Rivas Costa
2018-02-22  0:19     ` Pierre-Loup A. Griffais

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=20180220174540.GA8231@casa \
    --to=rodrigorivascosta@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.