This shows you the differences between two versions of the page.
Next revision | Previous 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 15:00] Luc Van Oostenryck [Using sparse] C=2 vs C=1 |
||
---|---|---|---|
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 32: | Line 32: | ||
===== Using sparse ===== | ===== Using sparse ===== | ||
- | To use sparse for kernel development simply pass on the C=1 argument onto your make command. For example to enable sparse for mac80211 development you would use: | + | To use sparse for kernel development simply pass on the C=2 argument onto your make command. For example to enable sparse for mac80211 development you would use: |
- | <code>make C=1 M=net/mac80211/</code> | + | <code>make C=2 M=net/mac80211/</code> |
- | ===== 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: | + | This will force-check all corresponding source files. To only check files which will be recompiled you would use the C=1 argument: |
- | <code>CF="-D__CHECK_ENDIAN__" </code> | + | <code>make C=1 M=net/mac80211/</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> | + | ===== Endian checks ===== |
+ | |||
+ | 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. |