User: Password:
|
|
Subscribe / Log in / New account

sparse is not to blame

sparse is not to blame

Posted Oct 13, 2005 5:49 UTC (Thu) by proski (subscriber, #104)
Parent article: Introducing gfp_t

It's important to note that the patch is not dictated by any shortcomings of sparse. No good code checker would like a function that takes enum as argument but passes it as int to other functions. Also, the patch mostly replaces "unsigned int __nocast", which is sparse specific, with gfp_t, which is not (except that its definition uses __nocast in one header file).


(Log in to post comments)

sparse is not to blame

Posted Oct 14, 2005 9:00 UTC (Fri) by viro (subscriber, #7872) [Link]

__nocast is actually not the best way to do that in sparse (thus
the switch to __bitwise later in the series); it's far too easy
to lose without sparse noticing. E.g. a function with __nocast foo
argument can pass it to function taking foo and nobody will notice;
it warns on implicit conversions, which catches quite a few mismatches,
but not all of them. __bitwise is a type qualifier and it's a lot
stronger. OTOH, it simply had not been there when Linus first added
annotations on (some) allocation functions.

What happens now is (a) switch to typedef (merged); (b) switch to
use of __bitwise in declaration and propagation of gfp_t use to
the rest of places where it's needed (post-2.6.14). Full set of
patches is done, it's just waiting for 2.6.14 to be released.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds