All of lore.kernel.org
 help / color / mirror / Atom feed
* Replacing chunks of code with Macro-generated code?
@ 2014-05-19 10:30 Matthias Beyer
  0 siblings, 0 replies; only message in thread
From: Matthias Beyer @ 2014-05-19 10:30 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I'm currently doing some cleanup in drivers/staging/bcm. In the file

    drivers/staging/bcm/CmHost.c

there is a function (namingly DumpCmControlPacket()), which uses the
BCM_DEBUG_PRINT macro _a lot_. The first four parameters are the same
for _every_ usage of the macro, so there would be the possibility to
cover the usage of the BCM_DEBUG_PRINT macro with another macro which
sets the first parameters per default.

Something like

    BCM_DEBUG_ADAPTER_DUMP(str,args...) \
        do { BCM_DEBUG_PRINT(/*etc*/); } while(0)

would be possible. But is this good coding style in manner of kernel
style?

The current state is just WALL_OF_TEXT-like. If you scroll over the
file, there are 500 lines just macro after macro. So I guess it would
be worth cleaning it up.

What do you thing?

-- 
Mit freundlichen Gr??en,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140519/1b617ccf/attachment.bin 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-19 10:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-19 10:30 Replacing chunks of code with Macro-generated code? Matthias Beyer

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.