Re: [PATCH v2] HID: corsair-void: Add Corsair Void headset family driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> * How do you think about to use the attribute “__free(kfree)” at more places accordingly?
>  https://elixir.bootlin.com/linux/v6.11-rc4/source/include/linux/slab.h#L282

Done, thanks

> * Would you like to reduce scopes for such local variables?

I thought the kernel programming style put the local variables at the
start of the function?

> Can condition checks be merged with the same return value (for less statements)?

Done

> Can such a size determination be explained better?

Well it allocates 3 bytes and immediately fills them, so I'm not sure
what I'd write except stating the obvious.
Unless you mean why it has to be allocated rather than just using the stack?

> I suggest to use another local variable for the previous return value
> so that such a reset can be avoided.

Done

> Is there a need to organise device attributes into separate subgroups?

If the driver ends up registering / deregistering the attributes
depending on if it's wired or wireless headset and the headset's
connection state, I'd say so.
Otherwise if the driver sticks with returning -ENODEV, then I don't
see a reason to split them up.

> I propose to omit the explicit initialisation for this local variable.

Done

> Please improve such a size determination.
>
> 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

Assuming you just wanted me to use `sizeof(*drvdata)`, done

> Please apply the statement “return 0;” instead.

Done

> > +/*failed_after_hid_start:
> > +     hid_hw_stop(hid_dev);*/
>
> Please reconsider the need once more also for this information.

Removed it

Thanks,
Stuart





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux