lkml.org 
[lkml]   [2005]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[sparse fix] (was Re: [PATCH] bogus cast in bio.c)
> fs/bio.c:686:15: warning: incorrect type in assignment (different address spaces)
> fs/bio.c:686:15: expected void [noderef] *iov_base<asn:1>
> fs/bio.c:686:15: got void [noderef] *<noident>
> from the first form (cast to __user void *). Lovely...
>
> OK, I think I know what's going on there, will fix.

What happens is actually pretty simple - we get address_space(1) handled
in declaration_specifiers(), which sets ctype->as to 1. Then we see
"void" and eventually get to
ctype->base_type = type;
}

check_modifiers(&token->pos, s, ctype->modifiers);
apply_ctype(token->pos, &thistype, ctype);
with thistype coming from lookup for "void". And that, of course, has
zero ->as. Now apply_ctype merrily buggers ctype->as and we have 0...

So AFAICS proper fix for sparse should be to check thistype->as to see
if it really has any intention to change ->as. ACK?

--- parse.c 2005-09-07 17:03:13.000000000 -0400
+++ parse.c.new 2005-09-09 13:25:01.000000000 -0400
@@ -636,7 +636,8 @@
ctype->alignment = thistype->alignment;

/* Address space */
- ctype->as = thistype->as;
+ if (thistype->as)
+ ctype->as = thistype->as;
}

static void check_modifiers(struct position *pos, struct symbol *s, unsigned long mod)
-
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/
\
 
 \ /
  Last update: 2005-09-09 19:32    [W:0.044 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site