Re: 1 New compile/sparse warning (overnight build)

From: Jens Axboe (axboe_at_suse.de)
Date: 09/29/04

  • Next message: Luke Kenneth Casson Leighton: "Re: [PATCH] to allow sys_pread64 and sys_pwrite64 to be used from modules"
    Date:	Wed, 29 Sep 2004 19:33:43 +0200
    To: John Cherry <cherry@osdl.org>
    
    

    On Wed, Sep 29 2004, John Cherry wrote:
    > This sparse warning was introduced with patch 1.2000 (axboe).
    > In fs/bio.c (line 509),
    >
    > if (copy_from_user(addr, (char *) p, bvec->bv_len))
    >
    > should probably be
    >
    > if (copy_from_user(addr, (char __user *) p, bvec->bv_len))

    It's not a new warning, just look at your own generated output:

    > New warnings:
    > -------------
    > fs/bio.c:509:30: warning: incorrect type in argument 2 (different
    > address spaces)
    > fs/bio.c:509:30: expected void const [noderef] *from<asn:1>
    > fs/bio.c:509:30: got char *<noident>
    >
    >
    > Fixed warnings:
    > ---------------
    > fs/bio.c:462:31: warning: incorrect type in argument 2 (different
    > address spaces)
    > fs/bio.c:462:31: expected void const [noderef] *from<asn:1>
    > fs/bio.c:462:31: got char *<noident>

    The warning simply moved. This should fix it, though.

    Signed-off-by: Jens Axboe <axboe@suse.de>

    ===== fs/bio.c 1.67 vs edited =====
    --- 1.67/fs/bio.c 2004-09-28 17:59:14 +02:00
    +++ edited/fs/bio.c 2004-09-29 19:34:39 +02:00
    @@ -497,7 +497,7 @@
              * success
              */
             if (!write_to_vm) {
    - unsigned long p = uaddr;
    + char __user *p = (char __user *) uaddr;
     
                     /*
                      * for a write, copy in data to kernel pages
    @@ -506,7 +506,7 @@
                     bio_for_each_segment(bvec, bio, i) {
                             char *addr = page_address(bvec->bv_page);
     
    - if (copy_from_user(addr, (char *) p, bvec->bv_len))
    + if (copy_from_user(addr, p, bvec->bv_len))
                                     goto cleanup;
                             p += bvec->bv_len;
                     }

    -- 
    Jens Axboe
    -
    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/
    

  • Next message: Luke Kenneth Casson Leighton: "Re: [PATCH] to allow sys_pread64 and sys_pwrite64 to be used from modules"

    Relevant Pages

    • Re: Possible dcache BUG
      ... During the compile, the above line output this warning: ... Copyright 2004 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: New compiler warning: 2.6.4->2.6.5
      ... John Cherry escreveu: ... | drivers/pcmcia/i82365.c:71: warning: `version' defined but not used ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • PROBLEM: make menuconfig command with kernel 2.6.4
      ... Is this a problem of my system or a kernel/compiler bug?! ... Here the output of my bash: ... scripts/basic/fixdep.c:193: warning: unused variable `s' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: + shut-up-warnings-in-ipc-shmc.patch added to -mm tree
      ... > warning. ... I'm with Matt on the typechecking here, and at first liked his proposal; ... they're turning out to be real pigs instead. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: question about module and undeinfed symbols.
      ... I think the problem is isolated, I notices that System.map doesnt ... A warning appear during kernel compilation, ... parameter names in function declaration ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)