Today I learned how to use sparse. It is a great tool that picks up warnings that aren’t caught by the compiler.

Getting Sparse on Ubuntu:

sudo apt-get install sparse

How to use sparse:

make M=drivers/staging/dgnc/ C=1

The types of warnings that I got from sparse for this driver were about adding markers and changing the types of variables. For example, some variables need the “marker” __iomem (it is used by the kernel to keep track of how memory is being used). No warning would pop up when compiling the code like normal. Sparse catches these problems.

Sparse is like the grammar police. =]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation