Re: [PATCH v2 5/5] staging: bcm: HandleControlPacket.c: breaking of long lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I guess you're right, it should be changed. But it is used a lot:

~/linux-next/drivers/staging/bcm$ grep -c -R BCM_DEBUG_PRINT ./ | grep -v ":0$"
./Bcmchar.c:148
./CmHost.c:299
./DDRInit.c:25
./InterfaceMisc.c:15
./InterfaceRx.c:13
./InterfaceTx.c:11
./IPv6Protocol.c:35
./LeakyBucket.c:30
./led_control.c:23
./nvm.c:210
./PHSModule.c:70
./Qos.c:70
./sort.c:2
./Transmit.c:12
./Debug.h:3
./HandleControlPacket.c:8
./hostmibs.c:1
./InterfaceDld.c:28
./InterfaceIdleMode.c:27
./InterfaceInit.c:23
./InterfaceIsr.c:15
./Misc.c:171

The first parameter seems to be always named 'Adapter' and since it's a macro
there would be the option to remove it from the parameter list.

> 1. Rename the macro to BCM_DEBUG or bcm_debug or bcm_dbg
> 3. Add #define DBG_TYPE_CMHOST CMHOST
> 4. Add DBG_TYPE_ and DBG_LVL_ to the BCM_DBG_PRINT macro
>    and delete those prefixes from the uses.
> 5. Add missing newline terminations to all the formats.

I fully agree with that.

> 2. Add #define DBG_LVL_0 0 for equivalence to the 0 use

I checked Bcmchar.c und 0 is used along with DBG_TYPE_PRINTK which
ignores the debug level. According to debug.h (lines 154-174) 0 shouldn't
be used. Since with DBG_TYPE_PRINTK only the parameters 'string' and 'args'
are needed a new short macro would be a cleaner and less verbose alternative:

#define BCM_DEBUG_PRINTK(string, args...) \
        BCM_DEBUG(Adapter, DBG_TYPE_PRINTK, 0, 0, string, ##args)

or

#define BCM_DEBUG_PRINTK(string, args...) \
        pr_info("%s:" string, __func__, ##args);

I could make those changes next week. What do you think of removing
the 'Adapter' parameter and a smaller macro for DBG_TYPE_PRINTK?

Regards,
Johannes
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux