[lkml]   [2004]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] ip2: fix compile warnings wrote:
    > This fixes the following compile errors in the ip2 and ip2main drivers:
    > CC drivers/char/ip2main.o
    > drivers/char/ip2main.c:470: warning: initialization from incompatible pointer type

    > diff -urN --exclude='*~' linux-2.6.10-rc3-mm1-original/drivers/char/ip2main.c linux-2.6.10-rc3-mm1/drivers/char/ip2main.c
    > --- linux-2.6.10-rc3-mm1-original/drivers/char/ip2main.c 2004-12-03 16:55:03.000000000 -0500
    > +++ linux-2.6.10-rc3-mm1/drivers/char/ip2main.c 2004-12-17 16:24:24.094730049 -0500
    > @@ -467,7 +466,7 @@
    > static struct tty_operations ip2_ops = {
    > .open = ip2_open,
    > .close = ip2_close,
    > - .write = ip2_write,
    > + .write = (void *) ip2_write,
    > .put_char = ip2_putchar,
    > .flush_chars = ip2_flush_chars,
    > .write_room = ip2_write_room,

    The write() prototype in tty_operations is:
    int (*write)(struct tty_struct * tty,
    const unsigned char *buf, int count);

    Somehow the cast does eliminate the compiler warning (and give
    a false sense of correctness).

    However, ip2main.c::ip2_write() should be modified like so:

    static int
    ip2_write( PTTY tty, const unsigned char *pData, int count)

    and drop the cast and fix the ip2_write comment (drop old arg 2),
    and fix the ip2_write() prototype.
    But then you (someone) will have to decide how to handle the
    dropped <user> parameter when calling i2Output()...
    I don't know the answer to that.
    I just changed <user> to 0 to get a clean build of ip2main.o,
    but ip2/i2lib.c still needs some work.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:08    [W:0.022 / U:87.740 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site