* [PATCH] cxl: Use fixed width predefined types in data structure.
@ 2016-08-04 13:56 Philippe Bergheaud
2016-08-04 14:26 ` David Laight
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Bergheaud @ 2016-08-04 13:56 UTC (permalink / raw)
To: linuxppc-dev
Cc: mrochs, manoj, ukrishn, mpe, imunsie, fbarrat, mikey, Philippe Bergheaud
This patch fixes a regression introduced by commit b810253.
It substitutes the type __u8 to u8 in the uapi header cxl.h,
because the latter is not always defined in userland build
environments, in particular when cross-compiling libcxl on
x86_64 linux machines (RHEL6.7 and Ubuntu 16.04).
It also makes the definition of cxl_event_afu_driver_reserved
more consistent with the other definitions in the header file.
Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
---
include/uapi/misc/cxl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/uapi/misc/cxl.h b/include/uapi/misc/cxl.h
index cbae529..180d526 100644
--- a/include/uapi/misc/cxl.h
+++ b/include/uapi/misc/cxl.h
@@ -136,8 +136,8 @@ struct cxl_event_afu_driver_reserved {
*
* Of course the contents will be ABI, but that's up the AFU driver.
*/
- size_t data_size;
- u8 data[];
+ __u32 data_size;
+ __u8 data[];
};
struct cxl_event {
--
2.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] cxl: Use fixed width predefined types in data structure.
2016-08-04 13:56 [PATCH] cxl: Use fixed width predefined types in data structure Philippe Bergheaud
@ 2016-08-04 14:26 ` David Laight
2016-08-05 7:09 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2016-08-04 14:26 UTC (permalink / raw)
To: 'Philippe Bergheaud', linuxppc-dev
Cc: mikey, mrochs, fbarrat, manoj, ukrishn, imunsie
From: Philippe Bergheaud
> Sent: 04 August 2016 14:56
> This patch fixes a regression introduced by commit b810253.
> It substitutes the type __u8 to u8 in the uapi header cxl.h,
> because the latter is not always defined in userland build
> environments, in particular when cross-compiling libcxl on
> x86_64 linux machines (RHEL6.7 and Ubuntu 16.04).
>=20
> It also makes the definition of cxl_event_afu_driver_reserved
> more consistent with the other definitions in the header file.
...
> diff --git a/include/uapi/misc/cxl.h b/include/uapi/misc/cxl.h
> index cbae529..180d526 100644
> --- a/include/uapi/misc/cxl.h
> +++ b/include/uapi/misc/cxl.h
> @@ -136,8 +136,8 @@ struct cxl_event_afu_driver_reserved {
> *
> * Of course the contents will be ABI, but that's up the AFU driver.
> */
> - size_t data_size;
> - u8 data[];
> + __u32 data_size;
> + __u8 data[];
> };
You've just changed 'data_size' from 64bit to 32bit (on 64bit systems).
This isn't mentioned in the commit message and changes the API.
I've NFI what it need to be...
David
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] cxl: Use fixed width predefined types in data structure.
2016-08-04 14:26 ` David Laight
@ 2016-08-05 7:09 ` Michael Ellerman
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2016-08-05 7:09 UTC (permalink / raw)
To: David Laight, 'Philippe Bergheaud', linuxppc-dev
Cc: mikey, mrochs, fbarrat, manoj, ukrishn, imunsie
David Laight <David.Laight@ACULAB.COM> writes:
> From: Philippe Bergheaud
>> Sent: 04 August 2016 14:56
>> This patch fixes a regression introduced by commit b810253.
>> It substitutes the type __u8 to u8 in the uapi header cxl.h,
>> because the latter is not always defined in userland build
>> environments, in particular when cross-compiling libcxl on
>> x86_64 linux machines (RHEL6.7 and Ubuntu 16.04).
>>
>> It also makes the definition of cxl_event_afu_driver_reserved
>> more consistent with the other definitions in the header file.
> ...
>> diff --git a/include/uapi/misc/cxl.h b/include/uapi/misc/cxl.h
>> index cbae529..180d526 100644
>> --- a/include/uapi/misc/cxl.h
>> +++ b/include/uapi/misc/cxl.h
>> @@ -136,8 +136,8 @@ struct cxl_event_afu_driver_reserved {
>> *
>> * Of course the contents will be ABI, but that's up the AFU driver.
>> */
>> - size_t data_size;
>> - u8 data[];
>> + __u32 data_size;
>> + __u8 data[];
>> };
>
> You've just changed 'data_size' from 64bit to 32bit (on 64bit systems).
> This isn't mentioned in the commit message and changes the API.
Yeah that's pretty fishy.
In practice I suspect there aren't thousands of users of that API, the
commit is only a month old, so we can probably still change it. But
please call it out in the change log.
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-05 7:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 13:56 [PATCH] cxl: Use fixed width predefined types in data structure Philippe Bergheaud
2016-08-04 14:26 ` David Laight
2016-08-05 7:09 ` Michael Ellerman
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.