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


Groups > linux.kernel > #1704892 > unrolled thread

[PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

Started byMikko Rapeli <mikko.rapeli@iki.fi>
First post2017-08-06 19:10 +0200
Last post2017-08-07 08:10 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2017-08-06 19:10 +0200
    Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32  and __u64 from linux/types.h James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-08-06 20:30 +0200
      Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32  and __u64 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2017-08-06 23:10 +0200
        Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32  and __u64 from linux/types.h James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-08-07 00:20 +0200
          Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32  and __u64 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2017-08-07 08:10 +0200

#1704892 — [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2017-08-06 19:10 +0200
Subject[PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h
Message-ID<ubxdU-50T-21@gated-at.bofh.it>
Fixes userspace compilation errors like:

scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-list before ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: linux-scsi@vger.kernel.org
---
 include/uapi/scsi/scsi_netlink_fc.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/uapi/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h
index cbf76e479761..2493a0f533dc 100644
--- a/include/uapi/scsi/scsi_netlink_fc.h
+++ b/include/uapi/scsi/scsi_netlink_fc.h
@@ -57,14 +57,14 @@
  */
 struct fc_nl_event {
 	struct scsi_nl_hdr snlh;		/* must be 1st element ! */
-	uint64_t seconds;
-	uint64_t vendor_id;
-	uint16_t host_no;
-	uint16_t event_datalen;
-	uint32_t event_num;
-	uint32_t event_code;
-	uint32_t event_data;
-} __attribute__((aligned(sizeof(uint64_t))));
+	__u64 seconds;
+	__u64 vendor_id;
+	__u16 host_no;
+	__u16 event_datalen;
+	__u32 event_num;
+	__u32 event_code;
+	__u32 event_data;
+} __attribute__((aligned(sizeof(__u64))));
 
 
 #endif /* SCSI_NETLINK_FC_H */
-- 
2.13.3

[toc] | [next] | [standalone]


#1704935 — Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

FromJames Bottomley <James.Bottomley@HansenPartnership.com>
Date2017-08-06 20:30 +0200
SubjectRe: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h
Message-ID<ubytj-5JT-5@gated-at.bofh.it>
In reply to#1704892
On Sun, 2017-08-06 at 18:43 +0200, Mikko Rapeli wrote:
> Fixes userspace compilation errors like:
> 
> scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-list 
> before ‘uint64_t’

Rather than patching the kernel, why not #include <stdint.h> in your
userspace programme?

James

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


#1704972 — Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2017-08-06 23:10 +0200
SubjectRe: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h
Message-ID<ubAYa-7l9-15@gated-at.bofh.it>
In reply to#1704935
Hi,

On Sun, Aug 06, 2017 at 11:22:53AM -0700, James Bottomley wrote:
> On Sun, 2017-08-06 at 18:43 +0200, Mikko Rapeli wrote:
> > Fixes userspace compilation errors like:
> > 
> > scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-list 
> > before ‘uint64_t’
> 
> Rather than patching the kernel, why not #include <stdint.h> in your
> userspace programme?

The userspace program is actually a test which checks that uapi headers
compile alone because several headers are not compiling at all and/or
require special tricks. The test is available here:

http://marc.info/?l=linux-kernel&m=150203944104544&w=2

I have tried that approach before but then:

https://lkml.org/lkml/2015/6/1/160

For some subsystems like fuse the above message was not enough and they
are including stdint.h in userspace. What shall we do with this old
scsi header file?

-Mikko

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


#1705011 — Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

FromJames Bottomley <James.Bottomley@HansenPartnership.com>
Date2017-08-07 00:20 +0200
SubjectRe: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h
Message-ID<ubC3Y-7ZI-79@gated-at.bofh.it>
In reply to#1704972
On Sun, 2017-08-06 at 23:42 +0300, Mikko Rapeli wrote:
> Hi,
> 
> On Sun, Aug 06, 2017 at 11:22:53AM -0700, James Bottomley wrote:
> > 
> > On Sun, 2017-08-06 at 18:43 +0200, Mikko Rapeli wrote:
> > > 
> > > Fixes userspace compilation errors like:
> > > 
> > > scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-
> > > list  before ‘uint64_t’
> > 
> > Rather than patching the kernel, why not #include <stdint.h> in
> > your userspace programme?
> 
> The userspace program is actually a test which checks that uapi
> headers compile alone because several headers are not compiling at
> all and/or require special tricks. The test is available here:
> 
> http://marc.info/?l=linux-kernel&m=150203944104544&w=2

But you don't seem to be detecting or fixing an existing problem.
 These types are width unambiguous and all current consumers of these
headers include stdint.h so you're churning the kernel for a problem
which doesn't currently exist for any consumer of this header.

I can agree not adding any more external uint<x>_t types for newly
exported headers so new consumers don't depend on an external standard
is reasonable, so checkpatch should warn if someone tries to add them;
I just don't see the benefit of going over the whole kernel changing
stuff that has worked fine for years.  Now if you can tell me there's
an actual bug somewhere, that's different ...

James

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


#1705114 — Re: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2017-08-07 08:10 +0200
SubjectRe: [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from linux/types.h
Message-ID<ubJoK-4w0-21@gated-at.bofh.it>
In reply to#1705011
On Sun, Aug 06, 2017 at 03:09:21PM -0700, James Bottomley wrote:
> On Sun, 2017-08-06 at 23:42 +0300, Mikko Rapeli wrote:
> > Hi,
> > 
> > On Sun, Aug 06, 2017 at 11:22:53AM -0700, James Bottomley wrote:
> > > 
> > > On Sun, 2017-08-06 at 18:43 +0200, Mikko Rapeli wrote:
> > > > 
> > > > Fixes userspace compilation errors like:
> > > > 
> > > > scsi/scsi_netlink_fc.h:60:2: error: expected specifier-qualifier-
> > > > list  before ‘uint64_t’
> > > 
> > > Rather than patching the kernel, why not #include <stdint.h> in
> > > your userspace programme?
> > 
> > The userspace program is actually a test which checks that uapi
> > headers compile alone because several headers are not compiling at
> > all and/or require special tricks. The test is available here:
> > 
> > http://marc.info/?l=linux-kernel&m=150203944104544&w=2
> 
> But you don't seem to be detecting or fixing an existing problem.
>  These types are width unambiguous and all current consumers of these
> headers include stdint.h so you're churning the kernel for a problem
> which doesn't currently exist for any consumer of this header.

The header file dependencies of scsi/scsi_netlink_fc.h are not explicit.
I will propose a patch which includes <stdint.h> in userspace then.

> I can agree not adding any more external uint<x>_t types for newly
> exported headers so new consumers don't depend on an external standard
> is reasonable, so checkpatch should warn if someone tries to add them;
> I just don't see the benefit of going over the whole kernel changing
> stuff that has worked fine for years.  Now if you can tell me there's
> an actual bug somewhere, that's different ...

Tools parsing and checking uapi headers need to be able to compile them
and thus need the explicit list of dependencies. If <stdint.h> is a
required dependency, then scsi/scsi_netlink_fc.h should include it.

scsi/scsi_netlink_fc.h is one of 42 problematic headers left in current
kernel and I want to fix it one way or the other.

-Mikko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web