[openib-general] fixing sparse warnings ?

Bryan O'Sullivan bos at pathscale.com
Thu Nov 2 08:33:39 PST 2006


Ramachandra K wrote:
> I've been searching for a while but cant seem to find any pointers on
> how to fix sparse warnings (like cast to restricted type etc) or in general
> making code sparse check safe.

Add annotations to the data types that you're using, and make them 
consistent.  For example, if you have a function that takes a u16, and 
you pass in a __le16, you need to decide whether it's the function or 
the caller that needs fixing.  And you then need to propagate out those 
annotations until all of your sources of problems have gone away.

It's a very simple process.

For more information, do a Google search for "sparse site:lwn.net".

	<b




More information about the general mailing list