]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: xhci: Remove buggy assignment in next_trb()
authorJohn Youn <John.Youn@synopsys.com>
Mon, 9 Aug 2010 20:56:11 +0000 (13:56 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:46:25 +0000 (16:46 -0700)
commitba6da120819f5ffc44cbb5a66fc70f1e9f2f858e
tree7e31c3cfe05e1af421912e54c24e6dd066f9aaa3
parente5af095003749e3f9bc1ff3db77ef7c91dc79459
USB: xhci: Remove buggy assignment in next_trb()

commit a1669b2c64a9c8b031e0ac5cbf2692337a577f7c upstream.

The code to increment the TRB pointer has a slight ambiguity that could
lead to a bug on different compilers.  The ANSI C specification does not
specify the precedence of the assignment operator over the postfix
operator.  gcc 4.4 produced the correct code (increment the pointer and
assign the value), but a MIPS compiler that one of John's clients used
assigned the old (unincremented) value.

Remove the unnecessary assignment to make all compilers produce the
correct assembly.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci-ring.c