Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583837 > unrolled thread

[net-next][PATCH] RDS: keep data type consistent in the user visible header

Started bySantosh Shilimkar <santosh.shilimkar@oracle.com>
First post2017-02-18 04:20 +0100
Last post2017-02-21 16:00 +0100
Articles 7 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [net-next][PATCH] RDS: keep data type consistent in the user visible header Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-02-18 04:20 +0100
    Re: [net-next][PATCH] RDS: keep data type consistent in the user  visible header David Miller <davem@davemloft.net> - 2017-02-20 16:30 +0100
      Re: [net-next][PATCH] RDS: keep data type consistent in the user  visible header Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2017-02-20 16:40 +0100
        Re: [net-next][PATCH] RDS: keep data type consistent in the user  visible header David Miller <davem@davemloft.net> - 2017-02-20 16:40 +0100
          RE: [net-next][PATCH] RDS: keep data type consistent in the user  visible header David Laight <David.Laight@ACULAB.COM> - 2017-02-21 15:40 +0100
            Re: [net-next][PATCH] RDS: keep data type consistent in the user  visible header "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com> - 2017-02-21 16:00 +0100
            Re: [net-next][PATCH] RDS: keep data type consistent in the user  visible header Edward Cree <ecree@solarflare.com> - 2017-02-21 16:00 +0100

#1583837 — [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2017-02-18 04:20 +0100
Subject[net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tc3IZ-4Qp-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1584668 — Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromDavid Miller <davem@davemloft.net>
Date2017-02-20 16:30 +0100
SubjectRe: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tcY4y-6nx-9@gated-at.bofh.it>
In reply to#1583837
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.

[toc] | [prev] | [next] | [standalone]


#1584678 — Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromSowmini Varadhan <sowmini.varadhan@oracle.com>
Date2017-02-20 16:40 +0100
SubjectRe: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tcYee-6r1-25@gated-at.bofh.it>
In reply to#1584668
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

[toc] | [prev] | [next] | [standalone]


#1584683 — Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromDavid Miller <davem@davemloft.net>
Date2017-02-20 16:40 +0100
SubjectRe: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tcYee-6r1-27@gated-at.bofh.it>
In reply to#1584678
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.

[toc] | [prev] | [next] | [standalone]


#1585383 — RE: [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromDavid Laight <David.Laight@ACULAB.COM>
Date2017-02-21 15:40 +0100
SubjectRE: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tdjLI-3P2-3@gated-at.bofh.it>
In reply to#1584683
> 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

[toc] | [prev] | [next] | [standalone]


#1585398 — Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header

From"santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>
Date2017-02-21 16:00 +0100
SubjectRe: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tdk55-3Wc-51@gated-at.bofh.it>
In reply to#1585383
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 :-)

[toc] | [prev] | [next] | [standalone]


#1585401 — Re: [net-next][PATCH] RDS: keep data type consistent in the user visible header

FromEdward Cree <ecree@solarflare.com>
Date2017-02-21 16:00 +0100
SubjectRe: [net-next][PATCH] RDS: keep data type consistent in the user visible header
Message-ID<tdk56-3Wc-65@gated-at.bofh.it>
In reply to#1585383
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web