]> Git Repo - qemu.git/commit
net/vmxnet3: fix debug macro pattern for vmxnet3
authorMiao Yan <[email protected]>
Tue, 8 Dec 2015 05:28:32 +0000 (21:28 -0800)
committerJason Wang <[email protected]>
Mon, 11 Jan 2016 03:01:34 +0000 (11:01 +0800)
commit71c2f5b9b3f386b6acae54f5646a445e50717806
tree1817982f5e1817046ea9392d87ac6da3e8f73d08
parent2e4ca7dbc11ab7fbdfbdefa1fd6dc4ed3e90eabe
net/vmxnet3: fix debug macro pattern for vmxnet3

Vmxnet3 uses the following debug macro style:

 #ifdef SOME_DEBUG
 #  define debug(...) do{ printf(...); } while (0)
 # else
 #  define debug(...) do{ } while (0)
 #endif

If SOME_DEBUG is undefined, then format string inside the
debug macro will never be checked by compiler. Code is
likely to break in the future when SOME_DEBUG is enabled
 because of lack of testing. This patch changes this
to the following:

 #define debug(...) \
  do { if (SOME_DEBUG_ENABLED) printf(...); } while (0)

Signed-off-by: Miao Yan <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Dmitry Fleytman <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
hw/net/vmxnet_debug.h
This page took 0.0257 seconds and 4 git commands to generate.