Daily Archives: August 19, 2013

You are browsing the site archives by date.

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. =]