lkml.org 
[lkml]   [2010]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectscsi_netlink: fix userspace warnings in scsi_netlink.h
    "make headers_check" gave following warning:

    CHECK include/scsi (3 files)
    include/scsi/scsi_netlink.h:108: found __[us]{8,16,32,64} type without #include <linux/types.h>

    It has previously been discussed the value of fixing
    scsi headers because glibc had their own copies of scsi headers.

    But that does not matter at all as there may ibe other
    users of the exported headers and exported headers
    should be warning free.

    The following patch does two things:
    1) include linux/types.h as suggested in the warning
    2) replace all uses of uintxx_t with the kernel exportable variants

    uintxx_t belongs to the namespace of
    userspace - and not in the kernel.
    At least not in the exprted headers.

    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
    ---
    diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h
    index 58ce8fe..180ed38 100644
    --- a/include/scsi/scsi_netlink.h
    +++ b/include/scsi/scsi_netlink.h
    @@ -23,6 +23,7 @@
    #define SCSI_NETLINK_H

    #include <linux/netlink.h>
    +#include <linux/types.h>


    /*
    @@ -40,12 +41,12 @@

    /* SCSI_TRANSPORT_MSG event message header */
    struct scsi_nl_hdr {
    - uint8_t version;
    - uint8_t transport;
    - uint16_t magic;
    - uint16_t msgtype;
    - uint16_t msglen;
    -} __attribute__((aligned(sizeof(uint64_t))));
    + __u8 version;
    + __u8 transport;
    + __u16 magic;
    + __u16 msgtype;
    + __u16 msglen;
    +} __attribute__((aligned(sizeof(__u64))));

    /* scsi_nl_hdr->version value */
    #define SCSI_NL_VERSION 1
    @@ -89,10 +90,10 @@ struct scsi_nl_hdr {
    */
    struct scsi_nl_host_vendor_msg {
    struct scsi_nl_hdr snlh; /* must be 1st element ! */
    - uint64_t vendor_id;
    - uint16_t host_no;
    - uint16_t vmsg_datalen;
    -} __attribute__((aligned(sizeof(uint64_t))));
    + __u64 vendor_id;
    + __u16 host_no;
    + __u16 vmsg_datalen;
    +} __attribute__((aligned(sizeof(__u64))));


    /*

    \
     
     \ /
      Last update: 2010-08-15 22:15    [W:0.027 / U:149.672 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site