Bug 13519
Summary: | Syntax error. Not enough parameters for macro 'qla_printk'. | ||
---|---|---|---|
Product: | SCSI Drivers | Reporter: | Martin Ettl (ettl.martin) |
Component: | QLOGIC QLA2XXX | Assignee: | scsi_drivers-qla2xxx |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | alan |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.30 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Martin Ettl
2009-06-12 12:25:12 UTC
On Fri, Jun 12, 2009 at 12:25:13PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > i have detected a wrong macro call in file qla_sup.c. To detect this issue i > used the static code analysis tool cppcheck. It prints the following output: > > [linux-2.6.30/drivers/scsi/qla2xxx/qla_sup.c:352]: (error) Syntax error. Not > enough parameters for macro 'qla_printk'. > > Take a look at file qla_sup.c line 352 > > DEBUG9_10(qla_printk( > "NVRAM didn't go ready...\n")); > > > The maro definition is in file qla_def.h (2657): > > #define qla_printk(level, ha, format, arg...) \ > dev_printk(level , &((ha)->pdev->dev) , format , ## arg) > > As you can see, it needs more than one parameter. I believe your tool is defective. As I understand the way variadic macros work, if there is no 'arg', the ## operator swallows up the preceeding symbol (ie the ',') and so you'll get: dev_printk(level , &((ha)->pdev->dev) , format); which is perfectly fine. You are right, this is a false positive of cppcheck Thanks anyway |