netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next][PATCH] RDS: keep data type consistent in the user visible header
@ 2017-02-18  3:15 Santosh Shilimkar
  2017-02-20 15:19 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Shilimkar @ 2017-02-18  3:15 UTC (permalink / raw)
  To: netdev, davem; +Cc: linux-kernel

From: Santosh Shilimkar <ssantosh@kernel.org>

rds.h is exported to /usr/include/rds.h,  so u8, u64 leads to
errors like below.

/usr/include/linux/rds.h:197: error: expected specifier-qualifier-list before 'u8'
/usr/include/linux/rds.h:202: error: expected specifier-qualifier-list before 'u8'

Fix it by following same types as rest of the user header.

Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh.shilimkar@oracle.org>
---
 include/uapi/linux/rds.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
index 3833113..a9e4c02 100644
--- a/include/uapi/linux/rds.h
+++ b/include/uapi/linux/rds.h
@@ -194,14 +194,14 @@ enum rds_message_rxpath_latency {
 };
 
 struct rds_rx_trace_so {
-	u8 rx_traces;
-	u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
+	uint8_t rx_traces;
+	uint8_t rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
 };
 
 struct rds_cmsg_rx_trace {
-	u8 rx_traces;
-	u8 rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
-	u64 rx_trace[RDS_MSG_RX_DGRAM_TRACE_MAX];
+	uint8_t rx_traces;
+	uint8_t rx_trace_pos[RDS_MSG_RX_DGRAM_TRACE_MAX];
+	uint64_t rx_trace[RDS_MSG_RX_DGRAM_TRACE_MAX];
 };
 
 /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-18  3:15 [net-next][PATCH] RDS: keep data type consistent in the user visible header Santosh Shilimkar
@ 2017-02-20 15:19 ` David Miller
  2017-02-20 15:37   ` Sowmini Varadhan
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2017-02-20 15:19 UTC (permalink / raw)
  To: santosh.shilimkar; +Cc: netdev, linux-kernel

From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Date: Fri, 17 Feb 2017 19:15:47 -0800

> From: Santosh Shilimkar <ssantosh@kernel.org>
> 
> rds.h is exported to /usr/include/rds.h,  so u8, u64 leads to
> errors like below.
> 
> /usr/include/linux/rds.h:197: error: expected specifier-qualifier-list before 'u8'
> /usr/include/linux/rds.h:202: error: expected specifier-qualifier-list before 'u8'
> 
> Fix it by following same types as rest of the user header.
> 
> Reported-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Signed-off-by: Santosh Shilimkar <ssantosh.shilimkar@oracle.org>

The correct fix it to use "__u8", "__u64", etc.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-20 15:19 ` David Miller
@ 2017-02-20 15:37   ` Sowmini Varadhan
  2017-02-20 15:39     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Sowmini Varadhan @ 2017-02-20 15:37 UTC (permalink / raw)
  To: David Miller; +Cc: santosh.shilimkar, netdev, linux-kernel

On (02/20/17 10:19), David Miller wrote:
> 
> The correct fix it to use "__u8", "__u64", etc.

So the rest of rds.h uses uint8_t, uint32_t etc 
Perhaps (I'm not sure of the origins) this was because
of the shared OpenIB.org BSD license etc using __u8 in
one place and uint8_t in another would seem inconsistent,
at the very least.

--Sowmini

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-20 15:37   ` Sowmini Varadhan
@ 2017-02-20 15:39     ` David Miller
  2017-02-21 14:29       ` David Laight
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2017-02-20 15:39 UTC (permalink / raw)
  To: sowmini.varadhan; +Cc: santosh.shilimkar, netdev, linux-kernel

From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Mon, 20 Feb 2017 10:37:22 -0500

> On (02/20/17 10:19), David Miller wrote:
>> 
>> The correct fix it to use "__u8", "__u64", etc.
> 
> So the rest of rds.h uses uint8_t, uint32_t etc 
> Perhaps (I'm not sure of the origins) this was because
> of the shared OpenIB.org BSD license etc using __u8 in
> one place and uint8_t in another would seem inconsistent,
> at the very least.

The entire file should use the proper "__uX" kernel types
rather than the uint* ones.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-20 15:39     ` David Miller
@ 2017-02-21 14:29       ` David Laight
  2017-02-21 14:55         ` santosh.shilimkar
  2017-02-21 14:58         ` Edward Cree
  0 siblings, 2 replies; 7+ messages in thread
From: David Laight @ 2017-02-21 14:29 UTC (permalink / raw)
  To: 'David Miller', sowmini.varadhan
  Cc: santosh.shilimkar, netdev, linux-kernel

> The entire file should use the proper "__uX" kernel types
> rather than the uint* ones.

The uint* ones are part of the C standard :-)

	David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-21 14:29       ` David Laight
@ 2017-02-21 14:55         ` santosh.shilimkar
  2017-02-21 14:58         ` Edward Cree
  1 sibling, 0 replies; 7+ messages in thread
From: santosh.shilimkar @ 2017-02-21 14:55 UTC (permalink / raw)
  To: David Laight, 'David Miller', sowmini.varadhan
  Cc: netdev, linux-kernel

On 2/21/17 6:29 AM, David Laight wrote:
>> The entire file should use the proper "__uX" kernel types
>> rather than the uint* ones.
>
> The uint* ones are part of the C standard :-)
>
Should have been uint*_t :-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header
  2017-02-21 14:29       ` David Laight
  2017-02-21 14:55         ` santosh.shilimkar
@ 2017-02-21 14:58         ` Edward Cree
  1 sibling, 0 replies; 7+ messages in thread
From: Edward Cree @ 2017-02-21 14:58 UTC (permalink / raw)
  To: David Laight, 'David Miller', sowmini.varadhan
  Cc: santosh.shilimkar, netdev, linux-kernel

On 21/02/17 14:29, David Laight wrote:
>> The entire file should use the proper "__uX" kernel types
>> rather than the uint* ones.
> The uint* ones are part of the C standard :-)
>
> 	David
>
... which is exactly why we can't use them.

http://yarchive.net/comp/linux/kernel_headers.html#17

Visibility of <stdint.h> types is defined by a twisty maze of standards, all different (POSIX, SuS, BSD_SOURCE, XOPEN_SOURCE...).

__u8 and friends are in the reserved system namespace, so we can safely use them in user headers.

-Ed

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-21 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-18  3:15 [net-next][PATCH] RDS: keep data type consistent in the user visible header Santosh Shilimkar
2017-02-20 15:19 ` David Miller
2017-02-20 15:37   ` Sowmini Varadhan
2017-02-20 15:39     ` David Miller
2017-02-21 14:29       ` David Laight
2017-02-21 14:55         ` santosh.shilimkar
2017-02-21 14:58         ` Edward Cree

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).