sparse: always enable endian checks
Subsystems (5)
PATCH 1/1 sparse: always enable endian checks
Checks enabled by __CHECK_ENDIAN__ produce less than a half of the sparse warnings. For instance, the allyesconfig configuration on linux-next (tag next-20110812) produces on x86_64:
no __CHECK_ENDIAN__ with __CHECK_ENDIAN__ stderr bytes: 1155037 1992954 (73% increase) stderr lines: 10716 18657 (74% increase) affected files: 1191 1458 (22% increase)
It is no longer true that __CHECK_ENDIAN__ produces so many warnings that other sparse warnings drown in the noise.
Janitors going through the whole tree are already prepared to search for the warnings they want to fix.
The main point of this patch is to make sure that developers of a particular driver who use sparse rarely get all the warnings for their code even if they forget to specify __CHECK_ENDIAN__ or mistype it.
Some developers actually added __CHECK_ENDIAN__ to the driver makefiles so they don't forget to use it. Remove them now.
Remove all references to __CHECK_ENDIAN__ from the documentation except the Chinese version, which would need to be updated separately.
---
Documentation/sparse.txt | 17 +++++------------ drivers/net/wireless/iwlegacy/Makefile | 2 -- drivers/net/wireless/iwlwifi/Makefile | 2 -- drivers/net/wireless/iwmc3200wifi/Makefile | 2 -- drivers/net/wireless/orinoco/Makefile | 3 --- drivers/net/wireless/rtlwifi/Makefile | 2 -- drivers/net/wireless/rtlwifi/rtl8192c/Makefile | 2 -- drivers/net/wireless/rtlwifi/rtl8192ce/Makefile | 2 -- drivers/net/wireless/rtlwifi/rtl8192cu/Makefile | 2 -- drivers/net/wireless/rtlwifi/rtl8192de/Makefile | 2 -- drivers/net/wireless/rtlwifi/rtl8192se/Makefile | 3 --- fs/logfs/logfs.h | 3 --- include/linux/types.h | 5 +---- net/mac80211/Makefile | 2 -- net/wireless/Makefile | 2 -- 15 files changed, 6 insertions(+), 45 deletions(-)
Documentation/sparse.txt +5 -12
@@ -42,13 +42,6 @@ sure that bitwise types don't get mixed up (little-endian vs big-endian vs cpu-endian vs whatever), and there the constant "0" really _is_ special. -__bitwise__ - to be used for relatively compact stuff (gfp_t, etc.) that -is mostly warning-free and is supposed to stay that way. Warnings will -be generated without __CHECK_ENDIAN__. - -__bitwise - noisy stuff; in particular, __le*/__be* are that. We really -don't want to drown in noise unless we'd explicitly asked for it. - Getting sparse ~~~~~~~~~~~~~~
@@ -81,10 +74,10 @@ recompiled, or use "make C=2" to run sparse on the files whether they need to be recompiled or not. The latter is a fast way to check the whole tree if you have already built it. -The optional make variable CF can be used to pass arguments to sparse. The -build system passes -Wbitwise to sparse automatically. To perform endianness -checks, you may define __CHECK_ENDIAN__: +The optional make variable CF can be used to pass arguments to sparse. For +example, use this to enable all sparse warnings: - make C=2 CF="-D__CHECK_ENDIAN__" + make C=2 CF="-Wsparse-all" -These checks are disabled by default as they generate a host of warnings. +Some sparse checks are disabled by default as they generate a host of warnings +about minor issues.
drivers/net/wireless/iwlegacy/Makefile +0 -2
@@ -21,5 +21,3 @@ iwl4965-$(CONFIG_IWLWIFI_LEGACY_DEBUGFS) += iwl-4965-debugfs.o obj-$(CONFIG_IWL3945) += iwl3945.o iwl3945-objs := iwl3945-base.o iwl-3945.o iwl-3945-rs.o iwl-3945-led.o iwl3945-$(CONFIG_IWLWIFI_LEGACY_DEBUGFS) += iwl-3945-debugfs.o - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/iwlwifi/Makefile +0 -2
@@ -21,5 +21,3 @@ iwlagn-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o iwlagn-$(CONFIG_IWLWIFI_DEVICE_SVTOOL) += iwl-sv-open.o CFLAGS_iwl-devtrace.o := -I$(src) - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/iwmc3200wifi/Makefile +0 -2
@@ -6,5 +6,3 @@ iwmc3200wifi-$(CONFIG_IWM_DEBUG) += debugfs.o iwmc3200wifi-$(CONFIG_IWM_TRACING) += trace.o CFLAGS_trace.o := -I$(src) - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/orinoco/Makefile +0 -3
@@ -12,6 +12,3 @@ obj-$(CONFIG_TMD_HERMES) += orinoco_tmd.o obj-$(CONFIG_NORTEL_HERMES) += orinoco_nortel.o obj-$(CONFIG_PCMCIA_SPECTRUM) += spectrum_cs.o obj-$(CONFIG_ORINOCO_USB) += orinoco_usb.o - -# Orinoco should be endian clean. -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/Makefile +0 -2
@@ -24,5 +24,3 @@ obj-$(CONFIG_RTL8192CE) += rtl8192ce/ obj-$(CONFIG_RTL8192CU) += rtl8192cu/ obj-$(CONFIG_RTL8192SE) += rtl8192se/ obj-$(CONFIG_RTL8192DE) += rtl8192de/ - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/rtl8192c/Makefile +0 -2
@@ -5,5 +5,3 @@ rtl8192c-common-objs := \ phy_common.o obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c-common.o - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/rtl8192ce/Makefile +0 -2
@@ -9,5 +9,3 @@ rtl8192ce-objs := \ trx.o obj-$(CONFIG_RTL8192CE) += rtl8192ce.o - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/rtl8192cu/Makefile +0 -2
@@ -10,5 +10,3 @@ rtl8192cu-objs := \ trx.o obj-$(CONFIG_RTL8192CU) += rtl8192cu.o - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/rtl8192de/Makefile +0 -2
@@ -10,5 +10,3 @@ rtl8192de-objs := \ trx.o obj-$(CONFIG_RTL8192DE) += rtl8192de.o - -ccflags-y += -D__CHECK_ENDIAN__
drivers/net/wireless/rtlwifi/rtl8192se/Makefile +0 -3
@@ -10,6 +10,3 @@ rtl8192se-objs := \ trx.o obj-$(CONFIG_RTL8192SE) += rtl8192se.o - -ccflags-y += -D__CHECK_ENDIAN__ -
fs/logfs/logfs.h +0 -3
@@ -10,9 +10,6 @@#ifndef FS_LOGFS_LOGFS_H #define FS_LOGFS_LOGFS_H -#undef __CHECK_ENDIAN__ -#define __CHECK_ENDIAN__ -#include <linux/btree.h> #include <linux/crc32.h> #include <linux/fs.h>
include/linux/types.h +1 -4
@@ -168,11 +168,8 @@ typedef u32 dma_addr_t;#else #define __bitwise__#endif -#ifdef __CHECK_ENDIAN__ +#define __bitwise __bitwise__ -#else -#define __bitwise -#endif typedef __u16 __bitwise __le16 ;typedef __u16 __bitwise __be16 ;
net/mac80211/Makefile +0 -2
@@ -57,5 +57,3 @@ rc80211_minstrel_ht-$(CONFIG_MAC80211_DEBUGFS) += rc80211_minstrel_ht_debugfs.o mac80211-$(CONFIG_MAC80211_RC_PID) += $(rc80211_pid-y) mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y) mac80211-$(CONFIG_MAC80211_RC_MINSTREL_HT) += $(rc80211_minstrel_ht-y) - -ccflags-y += -D__CHECK_ENDIAN__
net/wireless/Makefile +0 -2
@@ -15,8 +15,6 @@ cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o -ccflags-y += -D__CHECK_ENDIAN__ - $(obj)/regdb.c: $(src)/db.txt $(src)/genregdb.awk @$(AWK) -f $(srctree)/$(src)/genregdb.awk < $< > $@
Quoted 19 lines · Pavel Roskin
Checks enabled by
__CHECK_ENDIAN__produce less than a half of the sparse warnings. For instance, the allyesconfig configuration on linux-next (tag next-20110812) produces onx86_64:no __CHECK_ENDIAN__ with __CHECK_ENDIAN__ stderr bytes: 1155037 1992954 (73% increase) stderr lines: 10716 18657 (74% increase) affected files: 1191 1458 (22% increase)It is no longer true that
__CHECK_ENDIAN__produces so many warnings that other sparse warnings drown in the noise.Janitors going through the whole tree are already prepared to search for the warnings they want to fix.
The main point of this patch is to make sure that developers of a particular driver who use sparse rarely get all the warnings for their code even if they forget to specify
__CHECK_ENDIAN__or mistype it.
Quoted 7 lines
Some developers actually added
__CHECK_ENDIAN__to the driver makefiles so they don't forget to use it. Remove them now.Remove all references to
__CHECK_ENDIAN__from the documentation except the Chinese version, which would need to be updated separately.Signed-off-by Pavel Roskin <[email protected]>
Maybe ask Michal to merge it?
Sam
Quoted 23 lines · Sam Ravnborg
Quoted 22 lines · Pavel Roskin
Checks enabled by
__CHECK_ENDIAN__produce less than a half of the sparse warnings. For instance, the allyesconfig configuration on linux-next (tag next-20110812) produces onx86_64:no
__CHECK_ENDIAN__with__CHECK_ENDIAN__stderr bytes: 1155037 1992954 (73% increase) stderr lines: 10716 18657 (74% increase) affected files: 1191 1458 (22% increase)It is no longer true that
__CHECK_ENDIAN__produces so many warnings that other sparse warnings drown in the noise.Janitors going through the whole tree are already prepared to search for the warnings they want to fix.
The main point of this patch is to make sure that developers of a particular driver who use sparse rarely get all the warnings for their code even if they forget to specify
__CHECK_ENDIAN__or mistype it.Some developers actually added
__CHECK_ENDIAN__to the driver makefiles so they don't forget to use it. Remove them now.
Quoted 8 lines
Quoted 4 lines
Remove all references to
__CHECK_ENDIAN__from the documentation except the Chinese version, which would need to be updated separately.Signed-off-by Pavel Roskin <[email protected]>Acked-by Sam Ravnborg <[email protected]>Maybe ask Michal to merge it?
ping Michal... :)