[Home]

Summary:DAHLIN-00056: [patch] warnings from sparse
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2008-10-22 07:53:23Date Closed:2008-10-28 16:38:08
Priority:MinorRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) sparse_fixes_1.diff
( 1) sparse_log
Description:sparse is a static code parser written by Linus Torvalds mainly for usage with the kernel code. It can be found in http://www.kernel.org/pub/software/devel/sparse/ and is packaged with some distributions (in Debian: under non-free).

To check a kernel code with sparse, run either:

 make C=1 # test only newer code that is being compiled

or:
 
 make C=2 # test everything that can be built

The attached sparse_log is a log for building dahdi-linux r5118 with 'make C=2'

Right now the number of warnings and errors is:

$ egrep ' (warning|error):' sparse_log | wc -l
397

Also included is a patch that demonstrates fixing some of the simpler and more common issues ('static' and 'C99 initializor') in some of the modules.
Comments:By: Leif Madsen (lmadsen) 2008-10-22 10:20:52

Just wanted to send a reminder to Kevin so he can review this as it looks like something he will be best to comment on. I'm trying not to assign things to Kevin due to his work load, but wanted to point this one out specifically.

By: Digium Subversion (svnbot) 2008-10-27 10:42:45

Repository: dahdi
Revision: 5131

U   linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
U   linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c

------------------------------------------------------------------------
r5131 | tzafrir | 2008-10-27 10:42:45 -0500 (Mon, 27 Oct 2008) | 4 lines

xpp: Make some definitions static, as per sparse.

Fixes the xpp warnings of DAHLIN-56 (except some false alarms).

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=5131

By: Digium Subversion (svnbot) 2008-10-28 16:38:06

Repository: dahdi
Revision: 5162

U   linux/trunk/drivers/dahdi/dahdi-base.c
U   linux/trunk/drivers/dahdi/dahdi_dummy.c
U   linux/trunk/drivers/dahdi/dahdi_dynamic.c
U   linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
U   linux/trunk/drivers/dahdi/dahdi_dynamic_loc.c
U   linux/trunk/drivers/dahdi/dahdi_echocan_mg2.c
U   linux/trunk/drivers/dahdi/dahdi_transcode.c
U   linux/trunk/drivers/dahdi/pciradio.c
U   linux/trunk/drivers/dahdi/tor2.c
U   linux/trunk/drivers/dahdi/voicebus.c
_U  linux/trunk/drivers/dahdi/wcb4xxp/
U   linux/trunk/drivers/dahdi/wcb4xxp/base.c
U   linux/trunk/drivers/dahdi/wcfxo.c
U   linux/trunk/drivers/dahdi/wct1xxp.c
U   linux/trunk/drivers/dahdi/wct4xxp/base.c
U   linux/trunk/drivers/dahdi/wctc4xxp/base.c
U   linux/trunk/drivers/dahdi/wctdm.c
U   linux/trunk/drivers/dahdi/wctdm24xxp/GpakApi.c
U   linux/trunk/drivers/dahdi/wctdm24xxp/GpakCust.c
U   linux/trunk/drivers/dahdi/wctdm24xxp/base.c
U   linux/trunk/drivers/dahdi/wcte11xp.c
U   linux/trunk/drivers/dahdi/wcte12xp/GpakApi.c
U   linux/trunk/drivers/dahdi/wcte12xp/base.c
U   linux/trunk/drivers/dahdi/wcte12xp/vpmadt032.c
U   linux/trunk/drivers/dahdi/wcte12xp/vpmadt032.h

------------------------------------------------------------------------
r5162 | kpfleming | 2008-10-28 16:38:05 -0500 (Tue, 28 Oct 2008) | 8 lines

fix a large number of warnings found by sparse, the kernel code sanity checking tool. some of these fixes are non-optimal (casting 'unsigned long' to '__user void *'), but are unavoidable in many cases. started from tzafrir's patch, did most of the work myself.

(closes issue DAHLIN-56)
Reported by: tzafrir
Patches:
     sparse_fixes_1.diff uploaded by tzafrir (license 46)


------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=5162