[PATCH] linux/atm_tcp.h: cleanup for userspace - Kernel

This is a discussion on [PATCH] linux/atm_tcp.h: cleanup for userspace - Kernel ; The atm_tcp.h uses types from linux/atm.h, but does not include it. It should also use the standard __u## types from linux/types.h rather than the uint##_t types since the former can be found with the kernel already. Signed-off-by: Mike Frysinger --- ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: [PATCH] linux/atm_tcp.h: cleanup for userspace

  1. [PATCH] linux/atm_tcp.h: cleanup for userspace

    The atm_tcp.h uses types from linux/atm.h, but does not include it. It
    should also use the standard __u## types from linux/types.h rather than the
    uint##_t types since the former can be found with the kernel already.

    Signed-off-by: Mike Frysinger
    ---
    include/linux/atm_tcp.h | 10 ++++------
    1 files changed, 4 insertions(+), 6 deletions(-)

    diff --git a/include/linux/atm_tcp.h b/include/linux/atm_tcp.h
    index 18787f9..f05014e 100644
    --- a/include/linux/atm_tcp.h
    +++ b/include/linux/atm_tcp.h
    @@ -8,10 +8,8 @@
    #define LINUX_ATM_TCP_H

    #include
    -
    -#ifdef __KERNEL__
    #include
    -#endif
    +#include
    #include


    @@ -20,9 +18,9 @@
    */

    struct atmtcp_hdr {
    - uint16_t vpi;
    - uint16_t vci;
    - uint32_t length; /* ... of data part */
    + __u16 vpi;
    + __u16 vci;
    + __u32 length; /* ... of data part */
    };

    /*
    --
    1.5.5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] linux/atm_tcp.h: cleanup for userspace

    From: Mike Frysinger
    Date: Sat, 19 Apr 2008 23:22:34 -0400

    > The atm_tcp.h uses types from linux/atm.h, but does not include it. It
    > should also use the standard __u## types from linux/types.h rather than the
    > uint##_t types since the former can be found with the kernel already.
    >
    > Signed-off-by: Mike Frysinger


    I don't think this is a sufficient patch to solve these problems.

    > @@ -8,10 +8,8 @@
    > #define LINUX_ATM_TCP_H
    >
    > #include
    > -
    > -#ifdef __KERNEL__
    > #include
    > -#endif
    > +#include
    > #include
    >
    >


    So you're adding linux/atm.h as an include for non-kernel, fine,
    but:

    > @@ -20,9 +18,9 @@
    > */
    >
    > struct atmtcp_hdr {
    > - uint16_t vpi;
    > - uint16_t vci;
    > - uint32_t length; /* ... of data part */
    > + __u16 vpi;
    > + __u16 vci;
    > + __u32 length; /* ... of data part */
    > };
    >
    > /*


    Well, linux/atm.h, which we'll now get, has the same exact problem,
    it uses "uint16_t" and related types.

    Futehermore, nothing in the include chain will get linux/types.h
    include, which we'll need. linux/atm.h protects the inclusion
    of linux/types.h with __KERNEL__.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH] linux/atm_tcp.h: cleanup for userspace

    On Wednesday 23 April 2008, David Miller wrote:
    > From: Mike Frysinger
    > > The atm_tcp.h uses types from linux/atm.h, but does not include it. It
    > > should also use the standard __u## types from linux/types.h rather than
    > > the uint##_t types since the former can be found with the kernel already.
    > >
    > > Signed-off-by: Mike Frysinger

    >
    > I don't think this is a sufficient patch to solve these problems.


    it is sufficient for atm_tcp.h only. many of the network headers are broken
    for userspace inclusion, so i've just been posting them one at a time as last
    time i posted a large patch, no one picked it up.
    -mike

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.7 (GNU/Linux)

    iQIVAwUASA/4mEFjO5/oN/WBAQIJFg/+KYm02pULE/cGRtVOF/J6mxSiKRiTvFyG
    g9r7hrX6OKbIYBRL4yxjWoNG5PhXsktBF2Am3jmllU0hgSv6jZ eZyG4bg0VtpRVQ
    cA82Fa38Yuqw79KQBY07w9tVeWomku5KmLQr2QeNXJb/vYxqFM6eUs0mzr+1lMbd
    nLpf6AUxUULifyl8AUw2zIxkaNpkzRIKKj1UcNRXKyRCJXURAu 8ch+dYlXvGHpcx
    lnYxxdBxyHU5g7c0oBdor+0SjLtxCdRW3yxFm4uHIWYWFNK3UM 7Q2znWpoKq+Mqm
    WeIoX1fTxR1MaOlbllo3y+l7y7DUiMKxKvz9GIeAj50kJ1fdYW/rMSvYEC6QM+f5
    c9g9gGv0g6VVa51ToWdZi1lnssuF7EjESgIHc43M12CgGEyJUj iVq5pHx5JIP6xE
    BrsAjq4LFfESGVfKRNA5nXvdHDj5L3TACpksbCXPVKrbiNbqKV earQSLOlvP+fsb
    eO3gdfhCuYdx+f90dEAZWrWPf1tfsCsva+yi8XcS+5wdJxjnqv/NUL8g5nuSVAKG
    5qtogKOd89WfXbAC/K+PiEjia9yqYPRoY9m3/4JHbbCAH0Ia1wHAxsDfqwakI7LR
    aK6yYRpvPMmeEn/gkCvhCDJx8suthJH31Dpn4G+5GjOApBifkzwckSH9Haau/5gB
    p93PhB+bzkY=
    =DJwq
    -----END PGP SIGNATURE-----


  4. Re: [PATCH] linux/atm_tcp.h: cleanup for userspace

    From: Mike Frysinger
    Date: Wed, 23 Apr 2008 23:03:51 -0400

    > On Wednesday 23 April 2008, David Miller wrote:
    > > From: Mike Frysinger
    > > > The atm_tcp.h uses types from linux/atm.h, but does not include it. It
    > > > should also use the standard __u## types from linux/types.h rather than
    > > > the uint##_t types since the former can be found with the kernel already.
    > > >
    > > > Signed-off-by: Mike Frysinger

    > >
    > > I don't think this is a sufficient patch to solve these problems.

    >
    > it is sufficient for atm_tcp.h only. many of the network headers are broken
    > for userspace inclusion, so i've just been posting them one at a time as last
    > time i posted a large patch, no one picked it up.


    But you're adding an include of another file that has the problem
    you're supposedly fixing.

    If using uintN_t types is the problem, you're adding a new one for
    applications that include linux/atm_tcp.h, because now they'll
    get linux/atm.h as a side effect which does it too.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH] linux/atm_tcp.h: cleanup for userspace

    On Wednesday 23 April 2008, David Miller wrote:
    > From: Mike Frysinger
    > > On Wednesday 23 April 2008, David Miller wrote:
    > > > From: Mike Frysinger
    > > > > The atm_tcp.h uses types from linux/atm.h, but does not include it.
    > > > > It should also use the standard __u## types from linux/types.h rather
    > > > > than the uint##_t types since the former can be found with the kernel
    > > > > already.
    > > >
    > > > I don't think this is a sufficient patch to solve these problems.

    > >
    > > it is sufficient for atm_tcp.h only. many of the network headers are
    > > broken for userspace inclusion, so i've just been posting them one at a
    > > time as last time i posted a large patch, no one picked it up.

    >
    > But you're adding an include of another file that has the problem
    > you're supposedly fixing.


    and i'll send out fixes for that file in time.

    > If using uintN_t types is the problem, you're adding a new one for
    > applications that include linux/atm_tcp.h, because now they'll
    > get linux/atm.h as a side effect which does it too.


    any applications that use linux/atm_tcp.h are already including linux/atm.h,
    and already including stdint.h (or whatever indirectly to get uintN_t types).
    nothing new is broken, but eventually things will be all fixed.
    -mike

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.7 (GNU/Linux)

    iQIVAwUASA//dkFjO5/oN/WBAQIbbhAAhrsNKQ+ti0H56V8+zmNxDDoy/K89giYS
    rBMzPERLf0v1NY2d/uU//MfasoxPOTmIFnL4pWpBzVR8KwnGuvZXickNre0Ojzox
    MWDwv8EqYGNSpE+nYzRCgXcvZmbhlV3PRKkutwvGyVyx/QCaoyC9f67wwTb0mWJd
    7902sGiKD1jj6r6EoEknnFeXyc5n0Fz6fygrNtw19r6FNRjxz/1Avh6pfNyB1YyJ
    +KwaDENDWpdfUoC0ry+YH5UxUj2s9RD7wiJoDbThRgaSrtseb8 MsXC0M0ydVBNPK
    YHXJfiMOM5L8eEDE6ESpHs/jW/tvgUnHnYW0cS5IjixA3snXdVBdOkcybekaCFu7
    9VtnpxvZb1zfpX9gFiWbfJ+zoY2gz6ZUg+y3WteeYQAaxYW0mM OKWWRmnffuslqO
    xGF1S/14YrWMcamwct239568pJTOK6w7FW/i3n5IgCKs7Bme0H5zPv5dhC5RJrHm
    rFGTnG0hh8vl7GftEC1oOdZ2mVW+eZDHhYmkgkOUM3UlIV9f92 pveLo2BwBh9Ilc
    3sA9ywf/qCdO5Zsp+c21FT8EgYrtN/wKQ3qBsvkr9FojKGHWCNyokAPYeGQB5/kC
    SVIX2AnQD0zAZleAASWjrBb4Ww63DYq4bqfzwdU2tHK9zpNKQ9 x1hIL2ArrDP7Z+
    Ckgs4K1+CHE=
    =kFNV
    -----END PGP SIGNATURE-----


  6. Re: [PATCH] linux/atm_tcp.h: cleanup for userspace

    From: Mike Frysinger
    Date: Wed, 23 Apr 2008 23:33:10 -0400

    > On Wednesday 23 April 2008, David Miller wrote:
    > > But you're adding an include of another file that has the problem
    > > you're supposedly fixing.

    >
    > and i'll send out fixes for that file in time.


    Please combine the two changes, so that we actually fix the
    problem.

    Thank you.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread