This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
en:developers:documentation:using-sparse [2015/01/26 09:49] 127.0.0.1 external edit |
en:developers:documentation:using-sparse [2019/03/30 14:56] Luc Van Oostenryck [Endian checks] automatically enabled since v4.10-rc1 |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Using sparse ===== | ===== Using sparse ===== | ||
- | Sparse is a semantic parser and static analyzer utility we use for Linux kernel development. We highly recommend to use spare for the wireless subsystem. Below are some quick instructions how to get this set up and how to use it. | + | Sparse is a semantic parser and static analyzer utility we use for Linux kernel development. We highly recommend using sparse for the wireless subsystem. Below are some quick instructions how to get this set up and how to use it. |
Line 17: | Line 17: | ||
===== Version of sparse to use ===== | ===== Version of sparse to use ===== | ||
- | We recommend to use the latest stable release of sparse. As of now this is v0.4.4, so you can do something as follows: | + | We recommend to use the latest stable release of sparse. As of now this is v0.5.1, so you can do something as follows: |
+ | <code>git checkout v0.5.1</code> | ||
- | <code>git checkout -b rel4 v0.4.4</code> | + | Or do <code>git tag -l</code> to see all releases. |
===== Install sparse ===== | ===== Install sparse ===== | ||
Line 39: | Line 39: | ||
===== Endian checks ===== | ===== Endian checks ===== | ||
- | Endian checks are encouraged. Most endian complaints are typically valid and reflect design issues. These should be reviewed carefully. Some drivers force-enable endian checks with sparse by forcing it through their own driver makefiles upstream. If drivers do not have these you can enable sparse checks yourself by appending to your make command: | + | Most endian complaints are typically valid and reflect design issues. These should be reviewed carefully. Happily, since v4.10-rc1 these checks are automatically enabled. |
- | + | ||
- | + | ||
- | <code>CF="-D__CHECK_ENDIAN__" </code> | + | |
- | To enforce endian checks on your driver you can use something as follows on your driver Makefile: | + | |
- | + | ||
- | + | ||
- | <code>ccflags-y += -D__CHECK_ENDIAN__</code> | + |