From: Felipe Balbi Date: Wed, 21 Dec 2011 11:13:33 +0000 (+0200) Subject: usb: renesas: pipe: convert a long if into a XOR operation X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=14ff96e04c0b29736c8c81fbe75e86dd373c8e22;p=linux-beck.git usb: renesas: pipe: convert a long if into a XOR operation This is just a minor optimization for the long if we have on the driver. When we want to check that one input is true and the other must be false, the bitwise XOR operator will achieve that for us. Tested-by: Kuninori Morimoto Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index c2559e80d41f..feb06d6d2814 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c @@ -330,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, if (dir_in) usbhsp_flags_set(pipe, IS_DIR_HOST); - if ((is_host && !dir_in) || - (!is_host && dir_in)) + if (!!is_host ^ !!dir_in) dir |= DIR_OUT; if (!dir)