Re: [RFC PATCH 5/8] qaic: Implement data path

From: Jeffrey Hugo
Date: Thu May 14 2020 - 12:46:15 EST


On 5/14/2020 10:37 AM, Greg KH wrote:
On Thu, May 14, 2020 at 10:12:03AM -0600, Jeffrey Hugo wrote:
On 5/14/2020 9:56 AM, Greg KH wrote:
On Thu, May 14, 2020 at 09:06:53AM -0600, Jeffrey Hugo wrote:
On 5/14/2020 8:14 AM, Greg KH wrote:
On Thu, May 14, 2020 at 08:07:43AM -0600, Jeffrey Hugo wrote:
+struct qaic_execute {
+ __u16 ver; /* struct version, must be 1 */

No need for structures to be versioned. If you change something, then
add a new ioctl if you really needed it.

Huh. We had thought the botching ioctls document advised having a version,
but as I double check that document, it infact does not.

Will remove.

Thanks, you can also remove the "reserved" variables as well as those
will not be needed either.

Are you sure?

Documentation/process/botching-up-ioctls.rst
Starting at Line 38:

"Pad the entire struct to a multiple of 64-bits if the structure contains
64-bit types - the structure size will otherwise differ on 32-bit versus
64-bit. Having a different structure size hurts when passing arrays of
structures to the kernel, or if the kernel checks the structure size, which
e.g. the drm core does."

The "reserved" variables seem to be in line with that.

Padding is fine to use, but don't use that as a "I'm reserving this to
use it for later" type of thing which is how I read the structure
definitions. I might be totally wrong, but you should be explicit here.

Ok, I think I see your point. I'll change them to be more explicit as padding.

--
Jeffrey Hugo
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.