From: 64903517@qq.com (wangyubin)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to use sparse to check my driver
Date: Wed, 12 Mar 2014 17:39:10 +0800 [thread overview]
Message-ID: <53202B3E.8000901@qq.com> (raw)
In-Reply-To: <CABMudhSvu1HSUd=S2e9FLujCjE5srCKDFzyfMJhs=wWKzwqtNA@mail.gmail.com>
Hi, silverstri
> how does it actually call 'spare'? Do I need to modify my Makefile to
> add a new target or something?
If you called 'make C=2 ... ', the make will auto call sparse to check
the source.
Obviously, you should install sparse first.
If you do the 'make C=2 drivers/staging/wlan-ng/', and don't get the
check results,
I think maybe the 'wlan-ng' doesn't include in your built target.
Please use 'make menuconfig' to add the target wlan-ng.
1. make menuconfig
2. select 'Device Drivers -->'
3. select 'Staging drivers -->'
4. select 'Prism2.5/3 USB driver' like this ' <M> Prism2.5/3 USB driver'
5. exit the menuconfig
6. make C=2 drivers/staging/wlan-ng/ then you will get the check result.
I had test it on kernel v2.6.32.61, and got the messages below:
================================================
CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86
CALL scripts/checksyscalls.sh
CHECK scripts/mod/empty.c
CHECK drivers/staging/wlan-ng/prism2usb.c
drivers/staging/wlan-ng/hfa384x_usb.c:2810:62: warning: dubious: !x | !y
drivers/staging/wlan-ng/prism2fw.c:124:14: warning: symbol 'ns3data' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:125:13: warning: symbol 's3data' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:128:14: warning: symbol 'ns3plug' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:129:13: warning: symbol 's3plug' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:132:14: warning: symbol 'ns3crc' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:133:12: warning: symbol 's3crc' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:136:14: warning: symbol 'ns3info' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:137:13: warning: symbol 's3info' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:140:5: warning: symbol 'startaddr'
was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:143:14: warning: symbol 'nfchunks'
was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:144:12: warning: symbol 'fchunk' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:152:7: warning: symbol 'pda' was not
declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:153:21: warning: symbol 'nicid' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:154:20: warning: symbol 'rfid' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:155:20: warning: symbol 'macid' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:156:20: warning: symbol 'priid' was
not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:193:5: warning: symbol 'prism2_fwtry'
was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:237:15: warning: memset with byte
count of 120000
drivers/staging/wlan-ng/prism2fw.c:460:15: warning: memset with byte
count of 120000
CC [M] drivers/staging/wlan-ng/prism2usb.o
In file included from drivers/staging/wlan-ng/prism2usb.c:5:0:
drivers/staging/wlan-ng/prism2fw.c: In function prism2_fwtry:
drivers/staging/wlan-ng/prism2fw.c:208:9: warning: format %d expects
argument of type int, but argument 3 has type size_t [-Wformat]
drivers/staging/wlan-ng/prism2fw.c: In function writeimage:
drivers/staging/wlan-ng/prism2fw.c:1109:1: warning: the frame size of
4272 bytes is larger than 2048 bytes [-Wframe-larger-than=]
CHECK drivers/staging/wlan-ng/p80211conv.c
CHECK drivers/staging/wlan-ng/p80211req.c
CHECK drivers/staging/wlan-ng/p80211wep.c
CHECK drivers/staging/wlan-ng/p80211wext.c
CHECK drivers/staging/wlan-ng/p80211netdev.c
LD [M] drivers/staging/wlan-ng/prism2_usb.o
==================================================
Best Regards!
wangyubin
On 03/12/2014 05:31 AM, m silverstri wrote:
> I am trying to use sparse to check my driver that I developed.
>
> >From http://kernelnewbies.org/Sparse, It said 'make C=2
> drivers/staging/wlan-ng/', what does it check it I do 'make C=2' and
> how does it actually call 'spare'? Do I need to modify my Makefile to
> add a new target or something?
>
> Thank you.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> .
>
>
prev parent reply other threads:[~2014-03-12 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 21:31 How to use sparse to check my driver m silverstri
2014-03-12 9:39 ` wangyubin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53202B3E.8000901@qq.com \
--to=64903517@qq.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.