From nobody Fri Jan 2 03:17:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27A3BCDB465 for ; Mon, 16 Oct 2023 11:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbjJPLfj (ORCPT ); Mon, 16 Oct 2023 07:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233069AbjJPLfh (ORCPT ); Mon, 16 Oct 2023 07:35:37 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E28D9 for ; Mon, 16 Oct 2023 04:35:34 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507a98517f3so1431694e87.0 for ; Mon, 16 Oct 2023 04:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697456133; x=1698060933; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=lyKxdiQOm+Lo3Lu3u7Gs3LczlTMbQv2V0jRPZ5mmpFE=; b=UQK8+c4giW58084LCeT7KYux3hPO62BWJPMxO6tMzQ5IcoI3kG1D6nvBp5V1kZsuMa L5ltQg6hj8/FXgu+8VFVUQ/jTTM27Wm/5v6/+x9ZF+rzIHDO39FgBmNAbzQnbzvr9SvX 3fgFXHzZEKSHyTdS7RCiubFKS8k3tvAptiNjX2jFbQroUYeHngmLMUCk9YzNR18gLGUl Rs9MCIDblRAxczb7zwhvEAHYvxzcGnCmIOEYIqo+eR/TitQa3kbL7YHRVNvzopk8g2zW muAF9dntFOSh1JcdYCQRsMD+v9g5zGwHFXvhU/PWEjkqHT3gh5t7OoBGLYcoDyCQ7FPt fiWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697456133; x=1698060933; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lyKxdiQOm+Lo3Lu3u7Gs3LczlTMbQv2V0jRPZ5mmpFE=; b=LnsUoH65ABctf9rf6A8V8BLm9GykC4dcnV1yMJCDnAdI7T2TTcEf3lUX2Oxqg4nqLx RYgrUD/Rnhkvd3wVMzIshUAcH0fC3pMe7ck/Q5hIv6c80HemEBEaOYFzwwldih7woQCT MKNwPiQ8y5LeS3FSooCEzqkT9Wm21aMIDL3emq5edHKzP2TSn4oStTG47Mc+juclAEeb v7c9xbF1fyYrG+xqv5vH1GnMCE6+hytDLgACCHZ0ATesxQzy79sWywWRU8LLPV9XDPmW 1tIDXaRSZpAnSMnhvEHsUty6jj4Tl4umLGyBSbaewI87EPb4nkksRM7NReKUB55NTwwf CBkA== X-Gm-Message-State: AOJu0YzSx03Y9yAPd+oggLL6qCVDhv9CkxWLG0BBDVt16TDIimo0JIj9 pGL+ipXuSc3pp6qVnFcdn2XqLbyr2pshyi2w X-Google-Smtp-Source: AGHT+IHdjPYzzec8MZJc/6vlrrQFDHieTJMBAVwF6D9Iv2GbZTRlswDySA/B0DW4Q4MajnF/SOA5KQ== X-Received: by 2002:a05:6512:3604:b0:503:9a4:26f7 with SMTP id f4-20020a056512360400b0050309a426f7mr24368265lfs.40.1697456132702; Mon, 16 Oct 2023 04:35:32 -0700 (PDT) Received: from gilbert-PC ([105.112.31.148]) by smtp.gmail.com with ESMTPSA id ay15-20020a05600c1e0f00b004063977eccesm6975714wmb.42.2023.10.16.04.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:35:30 -0700 (PDT) Date: Mon, 16 Oct 2023 12:35:23 +0100 From: Gilbert Adikankwu To: outreachy@lists.linux.dev, gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: emxx_udc: Remove unnecessary parentheses around condition tests Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix 47 warnings detected by checkpatch.pl about unnecessary parenthesis around condition tests. Signed-off-by: Gilbert Adikankwu --- drivers/staging/emxx_udc/emxx_udc.c | 72 ++++++++++++++--------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc= /emxx_udc.c index eb63daaca702..e8ddd691b788 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -149,8 +149,8 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, st= ruct usb_request *_req) /* SET_FEATURE */ recipient =3D (u8)(p_ctrl->bRequestType & USB_RECIP_MASK); selector =3D le16_to_cpu(p_ctrl->wValue); - if ((recipient =3D=3D USB_RECIP_DEVICE) && - (selector =3D=3D USB_DEVICE_TEST_MODE)) { + if (recipient =3D=3D USB_RECIP_DEVICE && + selector =3D=3D USB_DEVICE_TEST_MODE) { wIndex =3D le16_to_cpu(p_ctrl->wIndex); test_mode =3D (u32)(wIndex >> 8); _nbu2ss_set_test_mode(udc, test_mode); @@ -287,7 +287,7 @@ static int _nbu2ss_epn_exit(struct nbu2ss_udc *udc, str= uct nbu2ss_ep *ep) u32 num; u32 data; =20 - if ((ep->epnum =3D=3D 0) || (udc->vbus_active =3D=3D 0)) + if (ep->epnum =3D=3D 0 || udc->vbus_active =3D=3D 0) return -EINVAL; =20 num =3D ep->epnum - 1; @@ -336,7 +336,7 @@ static void _nbu2ss_ep_dma_init(struct nbu2ss_udc *udc,= struct nbu2ss_ep *ep) u32 data; =20 data =3D _nbu2ss_readl(&udc->p_regs->USBSSCONF); - if (((ep->epnum =3D=3D 0) || (data & (1 << ep->epnum)) =3D=3D 0)) + if (ep->epnum =3D=3D 0 || (data & (1 << ep->epnum)) =3D=3D 0) return; /* Not Support DMA */ =20 num =3D ep->epnum - 1; @@ -380,7 +380,7 @@ static void _nbu2ss_ep_dma_exit(struct nbu2ss_udc *udc,= struct nbu2ss_ep *ep) return; /* VBUS OFF */ =20 data =3D _nbu2ss_readl(&preg->USBSSCONF); - if ((ep->epnum =3D=3D 0) || ((data & (1 << ep->epnum)) =3D=3D 0)) + if (ep->epnum =3D=3D 0 || (data & (1 << ep->epnum)) =3D=3D 0) return; /* Not Support DMA */ =20 num =3D ep->epnum - 1; @@ -560,7 +560,7 @@ static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8= *p_buf, u32 length) union usb_reg_access temp_32; union usb_reg_access *p_buf_32 =3D (union usb_reg_access *)p_buf; =20 - if ((length > 0) && (length < sizeof(u32))) { + if (length > 0 && length < sizeof(u32)) { temp_32.dw =3D _nbu2ss_readl(&udc->p_regs->EP0_READ); for (i =3D 0 ; i < length ; i++) p_buf_32->byte.DATA[i] =3D temp_32.byte.DATA[i]; @@ -608,7 +608,7 @@ static int ep0_in_overbytes(struct nbu2ss_udc *udc, union usb_reg_access temp_32; union usb_reg_access *p_buf_32 =3D (union usb_reg_access *)p_buf; =20 - if ((i_remain_size > 0) && (i_remain_size < sizeof(u32))) { + if (i_remain_size > 0 && i_remain_size < sizeof(u32)) { for (i =3D 0 ; i < i_remain_size ; i++) temp_32.byte.DATA[i] =3D p_buf_32->byte.DATA[i]; _nbu2ss_ep_in_end(udc, 0, temp_32.dw, i_remain_size); @@ -701,7 +701,7 @@ static int _nbu2ss_ep0_in_transfer(struct nbu2ss_udc *u= dc, return result; } =20 - if ((i_remain_size < sizeof(u32)) && (result !=3D EP0_PACKETSIZE)) { + if (i_remain_size < sizeof(u32) && result !=3D EP0_PACKETSIZE) { p_buffer +=3D result; result +=3D ep0_in_overbytes(udc, p_buffer, i_remain_size); req->div_len =3D result; @@ -738,7 +738,7 @@ static int _nbu2ss_ep0_out_transfer(struct nbu2ss_udc *= udc, req->req.actual +=3D result; i_recv_length -=3D result; =20 - if ((i_recv_length > 0) && (i_recv_length < sizeof(u32))) { + if (i_recv_length > 0 && i_recv_length < sizeof(u32)) { p_buffer +=3D result; i_remain_size -=3D result; =20 @@ -891,8 +891,8 @@ static int _nbu2ss_epn_out_pio(struct nbu2ss_udc *udc, = struct nbu2ss_ep *ep, =20 req->req.actual +=3D result; =20 - if ((req->req.actual =3D=3D req->req.length) || - ((req->req.actual % ep->ep.maxpacket) !=3D 0)) { + if (req->req.actual =3D=3D req->req.length || + (req->req.actual % ep->ep.maxpacket) !=3D 0) { result =3D 0; } =20 @@ -914,8 +914,8 @@ static int _nbu2ss_epn_out_data(struct nbu2ss_udc *udc,= struct nbu2ss_ep *ep, =20 i_buf_size =3D min((req->req.length - req->req.actual), data_size); =20 - if ((ep->ep_type !=3D USB_ENDPOINT_XFER_INT) && (req->req.dma !=3D 0) && - (i_buf_size >=3D sizeof(u32))) { + if (ep->ep_type !=3D USB_ENDPOINT_XFER_INT && req->req.dma !=3D 0 && + i_buf_size >=3D sizeof(u32)) { nret =3D _nbu2ss_out_dma(udc, req, num, i_buf_size); } else { i_buf_size =3D min_t(u32, i_buf_size, ep->ep.maxpacket); @@ -954,8 +954,8 @@ static int _nbu2ss_epn_out_transfer(struct nbu2ss_udc *= udc, } } } else { - if ((req->req.actual =3D=3D req->req.length) || - ((req->req.actual % ep->ep.maxpacket) !=3D 0)) { + if (req->req.actual =3D=3D req->req.length || + (req->req.actual % ep->ep.maxpacket) !=3D 0) { result =3D 0; } } @@ -1106,8 +1106,8 @@ static int _nbu2ss_epn_in_data(struct nbu2ss_udc *udc= , struct nbu2ss_ep *ep, =20 num =3D ep->epnum - 1; =20 - if ((ep->ep_type !=3D USB_ENDPOINT_XFER_INT) && (req->req.dma !=3D 0) && - (data_size >=3D sizeof(u32))) { + if (ep->ep_type !=3D USB_ENDPOINT_XFER_INT && req->req.dma !=3D 0 && + data_size >=3D sizeof(u32)) { nret =3D _nbu2ss_in_dma(udc, ep, req, num, data_size); } else { data_size =3D min_t(u32, data_size, ep->ep.maxpacket); @@ -1238,7 +1238,7 @@ static void _nbu2ss_endpoint_toggle_reset(struct nbu2= ss_udc *udc, u8 ep_adrs) u8 num; u32 data; =20 - if ((ep_adrs =3D=3D 0) || (ep_adrs =3D=3D 0x80)) + if (ep_adrs =3D=3D 0 || ep_adrs =3D=3D 0x80) return; =20 num =3D (ep_adrs & 0x7F) - 1; @@ -1261,7 +1261,7 @@ static void _nbu2ss_set_endpoint_stall(struct nbu2ss_= udc *udc, struct nbu2ss_ep *ep; struct fc_regs __iomem *preg =3D udc->p_regs; =20 - if ((ep_adrs =3D=3D 0) || (ep_adrs =3D=3D 0x80)) { + if (ep_adrs =3D=3D 0 || ep_adrs =3D=3D 0x80) { if (bstall) { /* Set STALL */ _nbu2ss_bitset(&preg->EP0_CONTROL, EP0_STL); @@ -1392,8 +1392,8 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_u= dc *udc, bool bset) u8 ep_adrs; int result =3D -EOPNOTSUPP; =20 - if ((udc->ctrl.wLength !=3D 0x0000) || - (direction !=3D USB_DIR_OUT)) { + if (udc->ctrl.wLength !=3D 0x0000 || + direction !=3D USB_DIR_OUT) { return -EINVAL; } =20 @@ -1480,7 +1480,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc) u8 ep_adrs; int result =3D -EINVAL; =20 - if ((udc->ctrl.wValue !=3D 0x0000) || (direction !=3D USB_DIR_IN)) + if (udc->ctrl.wValue !=3D 0x0000 || direction !=3D USB_DIR_IN) return result; =20 length =3D @@ -1542,9 +1542,9 @@ static int std_req_set_address(struct nbu2ss_udc *udc) int result =3D 0; u32 wValue =3D le16_to_cpu(udc->ctrl.wValue); =20 - if ((udc->ctrl.bRequestType !=3D 0x00) || - (udc->ctrl.wIndex !=3D 0x0000) || - (udc->ctrl.wLength !=3D 0x0000)) { + if (udc->ctrl.bRequestType !=3D 0x00 || + udc->ctrl.wIndex !=3D 0x0000 || + udc->ctrl.wLength !=3D 0x0000) { return -EINVAL; } =20 @@ -1564,9 +1564,9 @@ static int std_req_set_configuration(struct nbu2ss_ud= c *udc) { u32 config_value =3D (u32)(le16_to_cpu(udc->ctrl.wValue) & 0x00ff); =20 - if ((udc->ctrl.wIndex !=3D 0x0000) || - (udc->ctrl.wLength !=3D 0x0000) || - (udc->ctrl.bRequestType !=3D 0x00)) { + if (udc->ctrl.wIndex !=3D 0x0000 || + udc->ctrl.wLength !=3D 0x0000 || + udc->ctrl.bRequestType !=3D 0x00) { return -EINVAL; } =20 @@ -1838,8 +1838,8 @@ static void _nbu2ss_ep_done(struct nbu2ss_ep *ep, } =20 #ifdef USE_DMA - if ((ep->direct =3D=3D USB_DIR_OUT) && (ep->epnum > 0) && - (req->req.dma !=3D 0)) + if (ep->direct =3D=3D USB_DIR_OUT && ep->epnum > 0 && + req->req.dma !=3D 0) _nbu2ss_dma_unmap_single(udc, ep, req, USB_DIR_OUT); #endif =20 @@ -1931,7 +1931,7 @@ static inline void _nbu2ss_epn_in_dma_int(struct nbu2= ss_udc *udc, mpkt =3D ep->ep.maxpacket; size =3D preq->actual % mpkt; if (size > 0) { - if (((preq->actual & 0x03) =3D=3D 0) && (size < mpkt)) + if ((preq->actual & 0x03) =3D=3D 0 && size < mpkt) _nbu2ss_ep_in_end(udc, ep->epnum, 0, 0); } else { _nbu2ss_epn_in_int(udc, ep, req); @@ -2428,8 +2428,8 @@ static int nbu2ss_ep_enable(struct usb_ep *_ep, } =20 ep_type =3D usb_endpoint_type(desc); - if ((ep_type =3D=3D USB_ENDPOINT_XFER_CONTROL) || - (ep_type =3D=3D USB_ENDPOINT_XFER_ISOC)) { + if (ep_type =3D=3D USB_ENDPOINT_XFER_CONTROL || + ep_type =3D=3D USB_ENDPOINT_XFER_ISOC) { pr_err(" *** %s, bat bmAttributes\n", __func__); return -EINVAL; } @@ -2438,7 +2438,7 @@ static int nbu2ss_ep_enable(struct usb_ep *_ep, if (udc->vbus_active =3D=3D 0) return -ESHUTDOWN; =20 - if ((!udc->driver) || (udc->gadget.speed =3D=3D USB_SPEED_UNKNOWN)) { + if (!udc->driver || udc->gadget.speed =3D=3D USB_SPEED_UNKNOWN) { dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__); return -ESHUTDOWN; } @@ -2603,8 +2603,8 @@ static int nbu2ss_ep_queue(struct usb_ep *_ep, } } =20 - if ((ep->epnum > 0) && (ep->direct =3D=3D USB_DIR_OUT) && - (req->req.dma !=3D 0)) + if (ep->epnum > 0 && ep->direct =3D=3D USB_DIR_OUT && + req->req.dma !=3D 0) _nbu2ss_dma_map_single(udc, ep, req, USB_DIR_OUT); #endif =20 --=20 2.34.1