]> xenbits.xensource.com Git - people/pauldu/xennet.git/commitdiff
Fix CHANGE macro
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 12 Mar 2015 10:22:41 +0000 (10:22 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 12 Mar 2015 11:51:41 +0000 (11:51 +0000)
The CHANGE(x, y) macro in adapter.c is supposed to evaluate to 0 if x and
y are identical, otherwise it is supposed to assign y to x and evaluate
to 1. The definition is incorrect though, and in the latter case the
assignment is done but the macro still evaluates to 0. This patch fixes
the problem.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xennet/adapter.c

index dcd629fe0f4b936a3392f3ce56756b50ead2e108..8616579529966ae51b451c030277749b55541a6c 100644 (file)
@@ -477,7 +477,7 @@ invalid_parameter:
                          (x) == NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED)
 #define TX_ENABLED(x)   ((x) == NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED ||            \
                          (x) == NDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED)
-#define CHANGE(x, y)    (((x) == (y)) ? 0 : (((x) = (y)) != (y)))
+#define CHANGE(x, y)    (((x) == (y)) ? 0 : (((x) = (y)), 1))
 
 static NDIS_STATUS
 AdapterGetTcpOffloadParameters(