Skip to contentSkip to conversation

uapi: fix linux/nfc.h userspace compilation errors

PATCH In review Dmitry V. Levin 3 participants 7 messages Feb 20, 2017 – Dec 28, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 uapi: fix linux/nfc.h userspace compilation errors

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:264:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:272:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

---
 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/nfc.h +2 -2
index f8ccc12..1b6d54a 100644
@@ -261,7 +261,7 @@ enum nfc_sdp_attr {
 #define NFC_SE_ENABLED  0x1
 
 struct sockaddr_nfc {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
@@ -269,7 +269,7 @@ struct sockaddr_nfc {
 
 #define NFC_LLCP_MAX_SERVICE_NAME 63
 struct sockaddr_nfc_llcp {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
Signature · 1 line
ldv
#1 lore raw

PATCH RESEND 1/1 uapi: fix linux/nfc.h userspace compilation errors

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

---
The patch was submitted almost 5 years ago, and I was under impression that it was applied among others of this kind, but, apparently, it's still relevant.

 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/nfc.h +2 -2
index f6e3c8c9c744..aadad43d943a 100644
@@ -263,7 +263,7 @@ enum nfc_sdp_attr {
 #define NFC_SE_ENABLED  0x1
 
 struct sockaddr_nfc {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
@@ -271,7 +271,7 @@ struct sockaddr_nfc {
 
 #define NFC_LLCP_MAX_SERVICE_NAME 63
 struct sockaddr_nfc_llcp {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
Signature · 1 line
ldv
#2 lore raw
Quoted 9 lines · Dmitry V. Levin

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

Please skip the link. There will be link added for current patch which leads to this discussion. There was no discussion in 2017.

Quoted 14 lines

---
The patch was submitted almost 5 years ago, and I was under impression that it was applied among others of this kind, but, apparently, it's still relevant.

 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/nfc.h +0 -0
index f6e3c8c9c744..aadad43d943a 100644

include/uapi/linux/nfc.h enum nfc_sdp_attr { · line 266

Quoted 5 lines
include/uapi/linux/nfc.h +1 -1
@@ -263,7 +263,7 @@ enum nfc_sdp_attr {
 #define NFC_SE_ENABLED  0x1
 
 struct sockaddr_nfc {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;

include/uapi/linux/nfc.h includes linux/socket.h which defines typedef:
__kernel_sa_family_t sa_family_t;
so how exactly the build is being fixed? How to reproduce it?

Best regards,
Krzysztof

#3 lore raw
Quoted 30 lines · Krzysztof Kozlowski
Quoted 9 lines · Dmitry V. Levin

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

Please skip the link. There will be link added for current patch which leads to this discussion. There was no discussion in 2017.

Quoted 16 lines

---
The patch was submitted almost 5 years ago, and I was under impression that it was applied among others of this kind, but, apparently, it's still relevant.

 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/nfc.h +0 -0
index f6e3c8c9c744..aadad43d943a 100644
@@ -263,7 +263,7 @@ enum nfc_sdp_attr {
 #define NFC_SE_ENABLED  0x1
 
Quoted 8 lines

include/uapi/linux/nfc.h enum nfc_sdp_attr { · line 266

Quoted 3 lines
include/uapi/linux/nfc.h +1 -1
 struct sockaddr_nfc {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;

include/uapi/linux/nfc.h includes linux/socket.h which defines typedef:
__kernel_sa_family_t sa_family_t;
so how exactly the build is being fixed? How to reproduce it?

Ok, I see the error - when user-space does not include sys/socket.h. Makes sense, can you resend with removed Link and with:

Fixes 23b7869c0fd0 ("NFC: add the NFC socket raw protocol")
Fixes d646960f7986 ("NFC: Initial LLCP support")

Best regards,
Krzysztof

#4 lore raw

PATCH v2 1/1 uapi: fix linux/nfc.h userspace compilation errors

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

Fixes 23b7869c0fd0 ("NFC: add the NFC socket raw protocol")
Fixes d646960f7986 ("NFC: Initial LLCP support")

---
v2: Removed Link tag, added Fixes and Cc tags.

 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/nfc.h +2 -2
index f6e3c8c9c744..aadad43d943a 100644
@@ -263,7 +263,7 @@ enum nfc_sdp_attr {
 #define NFC_SE_ENABLED  0x1
 
 struct sockaddr_nfc {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
@@ -271,7 +271,7 @@ struct sockaddr_nfc {
 
 #define NFC_LLCP_MAX_SERVICE_NAME 63
 struct sockaddr_nfc_llcp {
-	sa_family_t sa_family;
+	__kernel_sa_family_t sa_family;
 	__u32 dev_idx;
 	__u32 target_idx;
 	__u32 nfc_protocol;
Signature · 1 line
ldv
Reviewed-by on v2 1/1
#5 lore raw
Quoted 12 lines · Dmitry V. Levin

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

Fixes 23b7869c0fd0 ("NFC: add the NFC socket raw protocol")
Fixes d646960f7986 ("NFC: Initial LLCP support")
Quoted 6 lines

---
v2: Removed Link tag, added Fixes and Cc tags.

 include/uapi/linux/nfc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Best regards,
Krzysztof

maintainer Applied
#6 lore raw
In reply to Dmitry V. Levin
Quoted 8 lines · On Sun, 26 Dec 2021 16:01:27 +0300 Dmitry V. Levin wrote:

Replace sa_family_t with __kernel_sa_family_t to fix the following linux/nfc.h userspace compilation errors:

/usr/include/linux/nfc.h:266:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;
/usr/include/linux/nfc.h:274:2: error: unknown type name 'sa_family_t'
sa_family_t sa_family;

Quoted 4 lines
Fixes 23b7869c0fd0 ("NFC: add the NFC socket raw protocol")
Fixes d646960f7986 ("NFC: Initial LLCP support")

Applied to net:

commit 7175f02c4e5f ("uapi: fix linux/nfc.h userspace compilation errors")

thanks!