瀏覽代碼

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 <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi 14 年之前
父節點
當前提交
14ff96e04c
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/usb/renesas_usbhs/pipe.c

+ 1 - 2
drivers/usb/renesas_usbhs/pipe.c

@@ -330,8 +330,7 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
 	if (dir_in)
 	if (dir_in)
 		usbhsp_flags_set(pipe, IS_DIR_HOST);
 		usbhsp_flags_set(pipe, IS_DIR_HOST);
 
 
-	if ((is_host  && !dir_in) ||
-	    (!is_host && dir_in))
+	if (!!is_host ^ !!dir_in)
 		dir |= DIR_OUT;
 		dir |= DIR_OUT;
 
 
 	if (!dir)
 	if (!dir)