From patchwork Tue Jul 14 08:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 675311392 for ; Tue, 14 Jul 2020 08:51:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4534C21D7A for ; Tue, 14 Jul 2020 08:51:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="gc6rSXI6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726624AbgGNIva (ORCPT ); Tue, 14 Jul 2020 04:51:30 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:38887 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725820AbgGNIv3 (ORCPT ); Tue, 14 Jul 2020 04:51:29 -0400 X-UUID: 50ea7dd956d24e7e8057ce192bb15dab-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=hWYRkBLOw9WgpamN6/BmC8H435AWfMGjRIjXkdRf/SQ=; b=gc6rSXI66S0bUopQGNplXNlGBv64pbaMQ+6bzWYjNSILhr4XBF1OwQuQgZorhoWl8cDZp9o4EH9Vo60wfRzwBob4rcG97aaEusatgqE7CyKTvuOtEOoEOKCuZgSWFP7Z0/8xAgT2M2MsM+Yymb3RSw7KSRWN2JkLPiNB63M2Ovs=; X-UUID: 50ea7dd956d24e7e8057ce192bb15dab-20200714 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 559330439; Tue, 14 Jul 2020 16:50:34 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:32 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:30 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 1/9] usb: gadget: bdc: fix code check warning or error caused by spacing Date: Tue, 14 Jul 2020 16:48:46 +0800 Message-ID: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-TM-SNTS-SMTP: 5CF25D77951D526478A6ABB59154AC69AF00CFEA6B1B5ABB72EFB8E4B94433D72000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org fix up check warning caused by no spaces around operators, or multiple blank lines; fix up check error caused by space prohibited before ',' Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 12 ++++++------ drivers/usb/gadget/udc/bdc/bdc_cmd.c | 15 +++++++-------- drivers/usb/gadget/udc/bdc/bdc_cmd.h | 2 +- drivers/usb/gadget/udc/bdc/bdc_core.c | 4 ++-- drivers/usb/gadget/udc/bdc/bdc_ep.c | 31 ++++++++++++++----------------- drivers/usb/gadget/udc/bdc/bdc_udc.c | 5 ++--- 6 files changed, 32 insertions(+), 37 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index 6e1e881..f56ee76 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -112,7 +112,7 @@ #define BDC_CMD_EPC 0x2 #define BDC_CMD_DVC 0x1 #define BDC_CMD_CWS (0x1 << 5) -#define BDC_CMD_CST(p) (((p) & (0xf << 6))>>6) +#define BDC_CMD_CST(p) (((p) & (0xf << 6)) >> 6) #define BDC_CMD_EPN(p) ((p & 0x1f) << 10) #define BDC_SUB_CMD_ADD (0x1 << 17) #define BDC_SUB_CMD_FWK (0x4 << 17) @@ -150,13 +150,13 @@ #define BDC_VBS (1 << 25) #define BDC_PRS (1 << 24) #define BDC_PCS (1 << 23) -#define BDC_PSP(p) (((p) & (0x7 << 20))>>20) +#define BDC_PSP(p) (((p) & (0x7 << 20)) >> 20) #define BDC_SCN (1 << 8) #define BDC_SDC (1 << 7) #define BDC_SWS (1 << 4) -#define BDC_USPSC_RW (BDC_SCN|BDC_SDC|BDC_SWS|0xf) -#define BDC_PSP(p) (((p) & (0x7 << 20))>>20) +#define BDC_USPSC_RW (BDC_SCN | BDC_SDC | BDC_SWS | 0xf) +#define BDC_PSP(p) (((p) & (0x7 << 20)) >> 20) #define BDC_SPEED_FS 0x1 #define BDC_SPEED_LS 0x2 @@ -184,7 +184,7 @@ #define BDC_COP_RUN (2 << 29) #define BDC_COP_STP (4 << 29) -#define BDC_COP_MASK (BDC_COP_RST|BDC_COP_RUN|BDC_COP_STP) +#define BDC_COP_MASK (BDC_COP_RST | BDC_COP_RUN | BDC_COP_STP) #define BDC_COS (1 << 28) #define BDC_CSTS(p) (((p) & (0x7 << 20)) >> 20) @@ -218,7 +218,7 @@ #define BDC_SRR_DPI(p) (((p) & (0xff << 16)) >> 16) #define BDC_SRR_DPI_MASK 0x00ff0000 -#define MARK_CHAIN_BD (BD_CHAIN|BD_EOT|BD_SOT) +#define MARK_CHAIN_BD (BD_CHAIN | BD_EOT | BD_SOT) /* Control transfer BD specific fields */ #define BD_DIR_IN (1 << 25) diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.c b/drivers/usb/gadget/udc/bdc/bdc_cmd.c index 44c2a5e..fba0c68 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.c +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.c @@ -109,7 +109,7 @@ int bdc_dconfig_ep(struct bdc *bdc, struct bdc_ep *ep) { u32 cmd_sc; - cmd_sc = BDC_SUB_CMD_DRP_EP|BDC_CMD_EPN(ep->ep_num)|BDC_CMD_EPC; + cmd_sc = BDC_SUB_CMD_DRP_EP | BDC_CMD_EPN(ep->ep_num) | BDC_CMD_EPC; dev_dbg(bdc->dev, "%s ep->ep_num =%d cmd_sc=%x\n", __func__, ep->ep_num, cmd_sc); @@ -163,8 +163,7 @@ int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep) usb_endpoint_xfer_isoc(desc)) { param2 |= si; if (usb_endpoint_xfer_isoc(desc) && comp_desc) - mul = comp_desc->bmAttributes; - + mul = comp_desc->bmAttributes; } param2 |= mul << EPM_SHIFT; if (comp_desc) @@ -203,7 +202,7 @@ int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep) return -EINVAL; } - cmd_sc |= BDC_CMD_EPC|BDC_CMD_EPN(ep->ep_num)|BDC_SUB_CMD_ADD_EP; + cmd_sc |= BDC_CMD_EPC | BDC_CMD_EPN(ep->ep_num) | BDC_SUB_CMD_ADD_EP; dev_dbg(bdc->dev, "cmd_sc=%x param2=%08x\n", cmd_sc, param2); ret = bdc_submit_cmd(bdc, cmd_sc, param0, param1, param2); @@ -232,7 +231,7 @@ int bdc_ep_bla(struct bdc *bdc, struct bdc_ep *ep, dma_addr_t dma_addr) cpu_to_le32s(¶m0); cpu_to_le32s(¶m1); - cmd_sc |= BDC_CMD_EPN(ep->ep_num)|BDC_CMD_BLA; + cmd_sc |= BDC_CMD_EPN(ep->ep_num) | BDC_CMD_BLA; dev_dbg(bdc->dev, "cmd_sc=%x\n", cmd_sc); return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); @@ -245,7 +244,7 @@ int bdc_address_device(struct bdc *bdc, u32 add) u32 param2; dev_dbg(bdc->dev, "%s: add=%d\n", __func__, add); - cmd_sc |= BDC_SUB_CMD_ADD|BDC_CMD_DVC; + cmd_sc |= BDC_SUB_CMD_ADD | BDC_CMD_DVC; param2 = add & 0x7f; return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); @@ -263,7 +262,7 @@ int bdc_function_wake_fh(struct bdc *bdc, u8 intf) param0 |= TRA_PACKET; param0 |= (bdc->dev_addr << 25); param1 |= DEV_NOTF_TYPE; - param1 |= (FWK_SUBTYPE<<4); + param1 |= (FWK_SUBTYPE << 4); dev_dbg(bdc->dev, "param0=%08x param1=%08x\n", param0, param1); return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); @@ -277,7 +276,7 @@ int bdc_function_wake(struct bdc *bdc, u8 intf) dev_dbg(bdc->dev, "%s intf=%d", __func__, intf); param2 |= intf; - cmd_sc |= BDC_SUB_CMD_FWK|BDC_CMD_DNC; + cmd_sc |= BDC_SUB_CMD_FWK | BDC_CMD_DNC; return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); } diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.h b/drivers/usb/gadget/udc/bdc/bdc_cmd.h index 29cc988..c24e6fc 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.h +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.h @@ -16,7 +16,7 @@ int bdc_stop_ep(struct bdc *, int); int bdc_ep_set_stall(struct bdc *, int); int bdc_ep_clear_stall(struct bdc *, int); -int bdc_ep_set_halt(struct bdc_ep *, u32 , int); +int bdc_ep_set_halt(struct bdc_ep *, u32, int); int bdc_ep_bla(struct bdc *, struct bdc_ep *, dma_addr_t); int bdc_function_wake(struct bdc*, u8); int bdc_function_wake_fh(struct bdc*, u8); diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index d567e20..cbdc127 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -59,7 +59,7 @@ int bdc_stop(struct bdc *bdc) return 0; } temp &= ~BDC_COP_MASK; - temp |= BDC_COS|BDC_COP_STP; + temp |= BDC_COS | BDC_COP_STP; bdc_writel(bdc->regs, BDC_BDCSC, temp); ret = poll_oip(bdc, BDC_COP_TIMEOUT); @@ -83,7 +83,7 @@ int bdc_reset(struct bdc *bdc) temp = bdc_readl(bdc->regs, BDC_BDCSC); temp &= ~BDC_COP_MASK; - temp |= BDC_COS|BDC_COP_RST; + temp |= BDC_COS | BDC_COP_RST; bdc_writel(bdc->regs, BDC_BDCSC, temp); ret = poll_oip(bdc, BDC_COP_TIMEOUT); if (ret) diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index ba250cf..c573e9e 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -104,16 +104,16 @@ static inline void chain_table(struct bd_table *prev_table, u32 bd_p_tab) { /* Chain the prev table to next table */ - prev_table->start_bd[bd_p_tab-1].offset[0] = + prev_table->start_bd[bd_p_tab - 1].offset[0] = cpu_to_le32(lower_32_bits(next_table->dma)); - prev_table->start_bd[bd_p_tab-1].offset[1] = + prev_table->start_bd[bd_p_tab - 1].offset[1] = cpu_to_le32(upper_32_bits(next_table->dma)); - prev_table->start_bd[bd_p_tab-1].offset[2] = + prev_table->start_bd[bd_p_tab - 1].offset[2] = 0x0; - prev_table->start_bd[bd_p_tab-1].offset[3] = + prev_table->start_bd[bd_p_tab - 1].offset[3] = cpu_to_le32(MARK_CHAIN_BD); } @@ -275,7 +275,7 @@ static inline int find_end_bdi(struct bdc_ep *ep, int next_hwd_bdi) end_bdi = next_hwd_bdi - 1; if (end_bdi < 0) end_bdi = ep->bd_list.max_bdi - 1; - else if ((end_bdi % (ep->bd_list.num_bds_table-1)) == 0) + else if ((end_bdi % (ep->bd_list.num_bds_table - 1)) == 0) end_bdi--; return end_bdi; @@ -442,7 +442,7 @@ static int setup_bd_list_xfr(struct bdc *bdc, struct bdc_req *req, int num_bds) req_len = req->usb_req.length; maxp = usb_endpoint_maxp(ep->desc); tfs = roundup(req->usb_req.length, maxp); - tfs = tfs/maxp; + tfs = tfs / maxp; dev_vdbg(bdc->dev, "%s ep:%s num_bds:%d tfs:%d r_len:%d bd:%p\n", __func__, ep->name, num_bds, tfs, req_len, bd); @@ -450,7 +450,7 @@ static int setup_bd_list_xfr(struct bdc *bdc, struct bdc_req *req, int num_bds) dword2 = dword3 = 0; /* First bd */ if (!bdnum) { - dword3 |= BD_SOT|BD_SBF|(tfs<ep_num == 1) { @@ -682,7 +682,6 @@ static int ep0_queue(struct bdc_ep *ep, struct bdc_req *req) */ if (req->usb_req.length == 0) return 0; - } ret = usb_gadget_map_request(&bdc->gadget, &req->usb_req, ep->dir); if (ret) { @@ -793,7 +792,7 @@ static int ep_dequeue(struct bdc_ep *ep, struct bdc_req *req) start_pending = true; end_pending = true; } else if (end_bdi >= curr_hw_dqpi || end_bdi <= eqp_bdi) { - end_pending = true; + end_pending = true; } } else { if (start_bdi >= curr_hw_dqpi) { @@ -820,7 +819,7 @@ static int ep_dequeue(struct bdc_ep *ep, struct bdc_req *req) tbi = bdi_to_tbi(ep, req->bd_xfr.next_hwd_bdi); table = ep->bd_list.bd_table_array[tbi]; next_bd_dma = table->dma + - sizeof(struct bdc_bd)*(req->bd_xfr.next_hwd_bdi - + sizeof(struct bdc_bd) * (req->bd_xfr.next_hwd_bdi - tbi * ep->bd_list.num_bds_table); first_req = list_first_entry(&ep->queue, struct bdc_req, @@ -1009,14 +1008,14 @@ static void handle_xsr_succ_status(struct bdc *bdc, struct bdc_ep *ep, bdi_to_tbi(ep, short_bdi))) max_len_bds--; } else { - chain_bds = max_len_bds/bd_list->num_bds_table; + chain_bds = max_len_bds / bd_list->num_bds_table; max_len_bds -= chain_bds; } } else { /* there is a wrap in the ring within a xfr */ - chain_bds = (bd_list->max_bdi - start_bdi)/ + chain_bds = (bd_list->max_bdi - start_bdi) / bd_list->num_bds_table; - chain_bds += short_bdi/bd_list->num_bds_table; + chain_bds += short_bdi / bd_list->num_bds_table; max_len_bds = bd_list->max_bdi - start_bdi; max_len_bds += short_bdi; max_len_bds -= chain_bds; @@ -1076,7 +1075,6 @@ void bdc_xsf_ep0_setup_recv(struct bdc *bdc, struct bdc_sr *sreport) else bdc->ep0_state = WAIT_FOR_DATA_START; - dev_dbg(bdc->dev, "%s exit ep0_state:%s\n", __func__, ep0_state_string[bdc->ep0_state]); @@ -1344,7 +1342,7 @@ static int ep0_handle_status(struct bdc *bdc, epnum = wIndex & USB_ENDPOINT_NUMBER_MASK; if (epnum) { if ((wIndex & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) - epnum = epnum*2 + 1; + epnum = epnum * 2 + 1; else epnum *= 2; } else { @@ -1634,7 +1632,6 @@ static void ep0_xsf_complete(struct bdc *bdc, struct bdc_sr *sreport) dev_err(bdc->dev, "Unknown ep0_state:%s\n", ep0_state_string[bdc->ep0_state]); - } } @@ -1645,7 +1642,7 @@ void bdc_sr_xsf(struct bdc *bdc, struct bdc_sr *sreport) u32 sr_status; u8 ep_num; - ep_num = (le32_to_cpu(sreport->offset[3])>>4) & 0x1f; + ep_num = (le32_to_cpu(sreport->offset[3]) >> 4) & 0x1f; ep = bdc->bdc_ep_array[ep_num]; if (!ep || !(ep->flags & BDC_EP_ENABLED)) { dev_err(bdc->dev, "xsf for ep not enabled\n"); diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c index 248426a..15652c5 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_udc.c +++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c @@ -342,7 +342,7 @@ static irqreturn_t bdc_udc_interrupt(int irq, void *_bdc) /* update the hw dequeue pointer */ srr_int = bdc_readl(bdc->regs, BDC_SRRINT(0)); srr_int &= ~BDC_SRR_DPI_MASK; - srr_int &= ~(BDC_SRR_RWS|BDC_SRR_RST|BDC_SRR_ISR); + srr_int &= ~(BDC_SRR_RWS | BDC_SRR_RST | BDC_SRR_ISR); srr_int |= ((bdc->srr.dqp_index) << 16); srr_int |= BDC_SRR_IP; bdc_writel(bdc->regs, BDC_SRRINT(0), srr_int); @@ -527,10 +527,9 @@ int bdc_udc_init(struct bdc *bdc) bdc->gadget.sg_supported = false; - bdc->gadget.name = BRCM_BDC_NAME; ret = devm_request_irq(bdc->dev, bdc->irq, bdc_udc_interrupt, - IRQF_SHARED , BRCM_BDC_NAME, bdc); + IRQF_SHARED, BRCM_BDC_NAME, bdc); if (ret) { dev_err(bdc->dev, "failed to request irq #%d %d\n", From patchwork Tue Jul 14 08:48:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E1FE1392 for ; Tue, 14 Jul 2020 08:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E96FD221EB for ; Tue, 14 Jul 2020 08:50:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="rJ8uNTvE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726856AbgGNIun (ORCPT ); Tue, 14 Jul 2020 04:50:43 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:58666 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726041AbgGNIul (ORCPT ); Tue, 14 Jul 2020 04:50:41 -0400 X-UUID: 96eda75a2d7c4fc3b139c3d9f297cab5-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=5YIqALVMFuugFeMVZxDIGwn9ZO0g/zjUVYWtoDp2XUU=; b=rJ8uNTvEb2FVJfMOclrNIpmz8mtc5vPy3xQREbea1Zgr5I5aAo6N0lfVAsNyAj/UTWiMx1pcXO/KUfmW0LdqWSff7h1yy0icdP8esj9cylR06BcWH/0z0YDv4KJeK+w6psTLg94xMOfjXY0bPyjaDfNanj8/u4zXQBJ4MZguGg8=; X-UUID: 96eda75a2d7c4fc3b139c3d9f297cab5-20200714 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1556657873; Tue, 14 Jul 2020 16:50:37 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:33 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:32 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 2/9] usb: gadget: bdc: fix warning of embedded function name Date: Tue, 14 Jul 2020 16:48:47 +0800 Message-ID: <1594716535-24699-2-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: B8BC00DA040CFB3893839AA7B26C0A0BCC92D12777F3A9402E5ACB1AB69B73CE2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use '"%s...", __func__' to replace embedded function name Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc_dbg.c | 2 +- drivers/usb/gadget/udc/bdc/bdc_ep.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_dbg.c b/drivers/usb/gadget/udc/bdc/bdc_dbg.c index 7ba7448..9c03e13 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_dbg.c +++ b/drivers/usb/gadget/udc/bdc/bdc_dbg.c @@ -68,7 +68,7 @@ void bdc_dbg_srr(struct bdc *bdc, u32 srr_num) sr = bdc->srr.sr_bds; addr = bdc->srr.dma_addr; - dev_vdbg(bdc->dev, "bdc_dbg_srr sr:%p dqp_index:%d\n", + dev_vdbg(bdc->dev, "%s sr:%p dqp_index:%d\n", __func__, sr, bdc->srr.dqp_index); for (i = 0; i < NUM_SR_ENTRIES; i++) { sr = &bdc->srr.sr_bds[i]; diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index c573e9e..0c44002 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -756,7 +756,7 @@ static int ep_dequeue(struct bdc_ep *ep, struct bdc_req *req) dev_dbg(bdc->dev, "%s ep:%s start:%d end:%d\n", __func__, ep->name, start_bdi, end_bdi); - dev_dbg(bdc->dev, "ep_dequeue ep=%p ep->desc=%p\n", + dev_dbg(bdc->dev, "%s ep=%p ep->desc=%p\n", __func__, ep, (void *)ep->usb_ep.desc); /* Stop the ep to see where the HW is ? */ ret = bdc_stop_ep(bdc, ep->ep_num); @@ -1853,12 +1853,12 @@ static int bdc_gadget_ep_enable(struct usb_ep *_ep, int ret; if (!_ep || !desc || desc->bDescriptorType != USB_DT_ENDPOINT) { - pr_debug("bdc_gadget_ep_enable invalid parameters\n"); + pr_debug("%s invalid parameters\n", __func__); return -EINVAL; } if (!desc->wMaxPacketSize) { - pr_debug("bdc_gadget_ep_enable missing wMaxPacketSize\n"); + pr_debug("%s missing wMaxPacketSize\n", __func__); return -EINVAL; } From patchwork Tue Jul 14 08:48:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BC7413A4 for ; Tue, 14 Jul 2020 08:51:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53321221EB for ; Tue, 14 Jul 2020 08:51:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="rlsWiAri" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726398AbgGNIul (ORCPT ); Tue, 14 Jul 2020 04:50:41 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:1323 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725820AbgGNIuk (ORCPT ); Tue, 14 Jul 2020 04:50:40 -0400 X-UUID: 65a92e58ddae429aa8b7621b74b9a986-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=W/y420kbWaO6GK4t6Nc9Br0LkiIrvJUWkJeD0Ieos6k=; b=rlsWiArirqRW7K3jNOYK4Prdb4NdX4w9uXpaFmxzc9tuNb6y53eEeNfETwYymyAR5h2TDl3XvP8bOc05XpmgP8wD9BIPBs7pzMpFvpGcn/9VWyNaKweSAU/ra2YkQ+3/ESG8w6pcFEJgy26LxhmTYDJP+VDIEAYyIxi9wPzNWxk=; X-UUID: 65a92e58ddae429aa8b7621b74b9a986-20200714 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 492418105; Tue, 14 Jul 2020 16:50:36 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:34 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:33 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 3/9] usb: gadget: bdc: fix improper SPDX comment style for header file Date: Tue, 14 Jul 2020 16:48:48 +0800 Message-ID: <1594716535-24699-3-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: A485723BC2235A744514B15BCFB892FE534E75B11330134FA6BC01E2CCF3F2CD2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 2 +- drivers/usb/gadget/udc/bdc/bdc_cmd.h | 2 +- drivers/usb/gadget/udc/bdc/bdc_dbg.h | 2 +- drivers/usb/gadget/udc/bdc/bdc_ep.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index f56ee76..ee0eafc 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * bdc.h - header for the BRCM BDC USB3.0 device controller * diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.h b/drivers/usb/gadget/udc/bdc/bdc_cmd.h index c24e6fc..e481d36 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.h +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * bdc_cmd.h - header for the BDC debug functions * diff --git a/drivers/usb/gadget/udc/bdc/bdc_dbg.h b/drivers/usb/gadget/udc/bdc/bdc_dbg.h index 373d5ab..859d588 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_dbg.h +++ b/drivers/usb/gadget/udc/bdc/bdc_dbg.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * bdc_dbg.h - header for the BDC debug functions * diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.h b/drivers/usb/gadget/udc/bdc/bdc_ep.h index a37ff803..5bbd73f 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.h +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * bdc_ep.h - header for the BDC debug functions * From patchwork Tue Jul 14 08:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6E401392 for ; Tue, 14 Jul 2020 08:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEB52221EB for ; Tue, 14 Jul 2020 08:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ra50kKpX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgGNIuq (ORCPT ); Tue, 14 Jul 2020 04:50:46 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:15032 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726845AbgGNIup (ORCPT ); Tue, 14 Jul 2020 04:50:45 -0400 X-UUID: 28709503a4c64d9cae19874bedc1909c-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=cYKlO6AjvO0zN+B/+SEdBEWj9IJvdlm+7ddbRfto77Y=; b=Ra50kKpXthTrR5Vf0OF+HTVT8QGMW95F45+3XW06/oHriYhsrbMGvjYs2AmvUXho44P/X7TCkewYVO93gCIrugNgJ/iH5Lnn6BSH8GHVL+FsNlbbIH6W00mBhUzEHwtuuD97yxsKfexblk4XczYpz3TFerHn4M/VjBAL612ytSI=; X-UUID: 28709503a4c64d9cae19874bedc1909c-20200714 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1516079608; Tue, 14 Jul 2020 16:50:37 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:35 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:34 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 4/9] usb: gadget: bdc: remove bdc_ep_set_halt() declaration Date: Tue, 14 Jul 2020 16:48:49 +0800 Message-ID: <1594716535-24699-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 391F70AA9E9D925F66C2730FE470DD6FE7637FC7791DAF12E1E56ADCEF5E116B2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org No definition for bdc_ep_set_halt(), so remove it. Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc_cmd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.h b/drivers/usb/gadget/udc/bdc/bdc_cmd.h index e481d36..a3a6dbd 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.h +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.h @@ -16,7 +16,6 @@ int bdc_stop_ep(struct bdc *, int); int bdc_ep_set_stall(struct bdc *, int); int bdc_ep_clear_stall(struct bdc *, int); -int bdc_ep_set_halt(struct bdc_ep *, u32, int); int bdc_ep_bla(struct bdc *, struct bdc_ep *, dma_addr_t); int bdc_function_wake(struct bdc*, u8); int bdc_function_wake_fh(struct bdc*, u8); From patchwork Tue Jul 14 08:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C539B13A4 for ; Tue, 14 Jul 2020 08:51:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A780D221F0 for ; Tue, 14 Jul 2020 08:51:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="nnkd2px9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbgGNIvK (ORCPT ); Tue, 14 Jul 2020 04:51:10 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:31195 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726425AbgGNIvI (ORCPT ); Tue, 14 Jul 2020 04:51:08 -0400 X-UUID: 1313aa58237640ce94ad384f8b920d72-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ixlbvrkq115Vky0/ESWunURbVwqDvUQV9NKQDPvH8bU=; b=nnkd2px9FKbiCtsYsJQ1f+6+WBS6Njv8GMFco+EosvIlaWVe18wIk4yqclHIC1CIqeXj2sug+Itz4KeFihokSsjF7wilcxOuvXru7zE7HeEpEGYifShspd2++oR3QAw7sWauK7w9YS2rbPMVhGnmjaoxqy8j2CSSdU1kgXfNfJA=; X-UUID: 1313aa58237640ce94ad384f8b920d72-20200714 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1949484789; Tue, 14 Jul 2020 16:50:42 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:36 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:35 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 5/9] usb: gadget: bdc: add identifier name for function declaraion Date: Tue, 14 Jul 2020 16:48:50 +0800 Message-ID: <1594716535-24699-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 83A1CE272C312E96A517B930759390ED524DEEE3F76AB404B9F71B81D4474F6E2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This is used to avoid the warning of function arguments, e.g. WARNING:FUNCTION_ARGUMENTS: function definition argument 'u32' should also have an identifier name Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 28 ++++++++++++++-------------- drivers/usb/gadget/udc/bdc/bdc_cmd.h | 18 +++++++++--------- drivers/usb/gadget/udc/bdc/bdc_dbg.h | 8 ++++---- drivers/usb/gadget/udc/bdc/bdc_ep.h | 8 ++++---- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index ee0eafc..9615438 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -466,24 +466,24 @@ static inline void bdc_writel(void __iomem *base, u32 offset, u32 value) } /* Buffer descriptor list operations */ -void bdc_notify_xfr(struct bdc *, u32); -void bdc_softconn(struct bdc *); -void bdc_softdisconn(struct bdc *); -int bdc_run(struct bdc *); -int bdc_stop(struct bdc *); -int bdc_reset(struct bdc *); -int bdc_udc_init(struct bdc *); -void bdc_udc_exit(struct bdc *); -int bdc_reinit(struct bdc *); +void bdc_notify_xfr(struct bdc *bdc, u32 epnum); +void bdc_softconn(struct bdc *bdc); +void bdc_softdisconn(struct bdc *bdc); +int bdc_run(struct bdc *bdc); +int bdc_stop(struct bdc *bdc); +int bdc_reset(struct bdc *bdc); +int bdc_udc_init(struct bdc *bdc); +void bdc_udc_exit(struct bdc *bdc); +int bdc_reinit(struct bdc *bdc); /* Status report handlers */ /* Upstream port status change sr */ -void bdc_sr_uspc(struct bdc *, struct bdc_sr *); +void bdc_sr_uspc(struct bdc *bdc, struct bdc_sr *sreport); /* transfer sr */ -void bdc_sr_xsf(struct bdc *, struct bdc_sr *); +void bdc_sr_xsf(struct bdc *bdc, struct bdc_sr *sreport); /* EP0 XSF handlers */ -void bdc_xsf_ep0_setup_recv(struct bdc *, struct bdc_sr *); -void bdc_xsf_ep0_data_start(struct bdc *, struct bdc_sr *); -void bdc_xsf_ep0_status_start(struct bdc *, struct bdc_sr *); +void bdc_xsf_ep0_setup_recv(struct bdc *bdc, struct bdc_sr *sreport); +void bdc_xsf_ep0_data_start(struct bdc *bdc, struct bdc_sr *sreport); +void bdc_xsf_ep0_status_start(struct bdc *bdc, struct bdc_sr *sreport); #endif /* __LINUX_BDC_H__ */ diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.h b/drivers/usb/gadget/udc/bdc/bdc_cmd.h index a3a6dbd..533ad52 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.h +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.h @@ -10,14 +10,14 @@ #define __LINUX_BDC_CMD_H__ /* Command operations */ -int bdc_address_device(struct bdc *, u32); -int bdc_config_ep(struct bdc *, struct bdc_ep *); -int bdc_dconfig_ep(struct bdc *, struct bdc_ep *); -int bdc_stop_ep(struct bdc *, int); -int bdc_ep_set_stall(struct bdc *, int); -int bdc_ep_clear_stall(struct bdc *, int); -int bdc_ep_bla(struct bdc *, struct bdc_ep *, dma_addr_t); -int bdc_function_wake(struct bdc*, u8); -int bdc_function_wake_fh(struct bdc*, u8); +int bdc_address_device(struct bdc *bdc, u32 add); +int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep); +int bdc_dconfig_ep(struct bdc *bdc, struct bdc_ep *ep); +int bdc_stop_ep(struct bdc *bdc, int epnum); +int bdc_ep_set_stall(struct bdc *bdc, int epnum); +int bdc_ep_clear_stall(struct bdc *bdc, int epnum); +int bdc_ep_bla(struct bdc *bdc, struct bdc_ep *ep, dma_addr_t dma_addr); +int bdc_function_wake(struct bdc *bdc, u8 intf); +int bdc_function_wake_fh(struct bdc *bdc, u8 intf); #endif /* __LINUX_BDC_CMD_H__ */ diff --git a/drivers/usb/gadget/udc/bdc/bdc_dbg.h b/drivers/usb/gadget/udc/bdc/bdc_dbg.h index 859d588..acd8332 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_dbg.h +++ b/drivers/usb/gadget/udc/bdc/bdc_dbg.h @@ -12,10 +12,10 @@ #include "bdc.h" #ifdef CONFIG_USB_GADGET_VERBOSE -void bdc_dbg_bd_list(struct bdc *, struct bdc_ep*); -void bdc_dbg_srr(struct bdc *, u32); -void bdc_dbg_regs(struct bdc *); -void bdc_dump_epsts(struct bdc *); +void bdc_dbg_bd_list(struct bdc *bdc, struct bdc_ep *ep); +void bdc_dbg_srr(struct bdc *bdc, u32 srr_num); +void bdc_dbg_regs(struct bdc *bdc); +void bdc_dump_epsts(struct bdc *bdc); #else static inline void bdc_dbg_regs(struct bdc *bdc) { } diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.h b/drivers/usb/gadget/udc/bdc/bdc_ep.h index 5bbd73f..4d3affd 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.h +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.h @@ -9,9 +9,9 @@ #ifndef __LINUX_BDC_EP_H__ #define __LINUX_BDC_EP_H__ -int bdc_init_ep(struct bdc *); -int bdc_ep_disable(struct bdc_ep *); -int bdc_ep_enable(struct bdc_ep *); -void bdc_free_ep(struct bdc *); +int bdc_init_ep(struct bdc *bdc); +int bdc_ep_disable(struct bdc_ep *ep); +int bdc_ep_enable(struct bdc_ep *ep); +void bdc_free_ep(struct bdc *bdc); #endif /* __LINUX_BDC_EP_H__ */ From patchwork Tue Jul 14 08:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661979 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8146613A4 for ; Tue, 14 Jul 2020 08:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 695FF221EF for ; Tue, 14 Jul 2020 08:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="OhrQ1t5m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbgGNIuv (ORCPT ); Tue, 14 Jul 2020 04:50:51 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:58666 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726851AbgGNIun (ORCPT ); Tue, 14 Jul 2020 04:50:43 -0400 X-UUID: 5a419ba1839a453db2b797a0d2d60a8a-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=x8d1kEG6R+1qdYQiFEoh0ig9IPYEAfPS4Hed6ezF5p8=; b=OhrQ1t5m+ESdFkKDyOoNw1rD9iDC9NmPzBRnT4WWmsins8iXrCd6R5ZApYWBN3ups6MeV3XSECmXk8xUV3+wOZH9bVaOvvbxbF2QrzihrotQr0vxzyvh99nIgZqR3Q4X649PKqUk/sEmMEefaC2pg5XyDABg1R8BqG7EcbCYB2k=; X-UUID: 5a419ba1839a453db2b797a0d2d60a8a-20200714 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1449536428; Tue, 14 Jul 2020 16:50:39 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:37 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:36 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 6/9] usb: gadget: bdc: fix check warning of block comments alignment Date: Tue, 14 Jul 2020 16:48:51 +0800 Message-ID: <1594716535-24699-6-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 18474C77123EBD5264D3D952833CE7C25037C52314ACC75B1619A0426DD44BC32000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org fix the warning: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 2 +- drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- drivers/usb/gadget/udc/bdc/bdc_udc.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index 9615438..6940934 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -35,7 +35,7 @@ /* * Maximum size of ep0 response buffer for ch9 requests, * the set_sel request uses 6 so far, the max. -*/ + */ #define EP0_RESPONSE_BUFF 6 /* Start with SS as default */ #define EP0_MAX_PKT_SIZE 512 diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index 0c44002..eea66d5 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -68,7 +68,7 @@ static void ep_bd_list_free(struct bdc_ep *ep, u32 num_tabs) * check if the bd_table struct is allocated ? * if yes, then check if bd memory has been allocated, then * free the dma_pool and also the bd_table struct memory - */ + */ bd_table = bd_list->bd_table_array[index]; dev_dbg(bdc->dev, "bd_table:%p index:%d\n", bd_table, index); if (!bd_table) { diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c index 15652c5..ba9365e 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_udc.c +++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c @@ -164,7 +164,7 @@ static void bdc_func_wake_timer(struct work_struct *work) /* * Check if host has started transferring on endpoints * FUNC_WAKE_ISSUED is cleared when transfer has started after resume - */ + */ if (bdc->devstatus & FUNC_WAKE_ISSUED) { dev_dbg(bdc->dev, "FUNC_WAKE_ISSUED FLAG IS STILL SET\n"); /* flag is still set, so again send func wake */ @@ -205,7 +205,7 @@ static void handle_link_state_change(struct bdc *bdc, u32 uspc) * if not then send function wake again every * TNotification secs until host initiates * transfer to BDC, USB3 spec Table 8.13 - */ + */ schedule_delayed_work( &bdc->func_wake_notify, msecs_to_jiffies(BDC_TNOTIFY)); @@ -379,7 +379,7 @@ static int bdc_udc_start(struct usb_gadget *gadget, * Run the controller from here and when BDC is connected to * Host then driver will receive a USPC SR with VBUS present * and then driver will do a softconnect. - */ + */ ret = bdc_run(bdc); if (ret) { dev_err(bdc->dev, "%s bdc run fail\n", __func__); From patchwork Tue Jul 14 08:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8864A1392 for ; Tue, 14 Jul 2020 08:51:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FA2F221F0 for ; Tue, 14 Jul 2020 08:51:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="ivXEaD7a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgGNIu7 (ORCPT ); Tue, 14 Jul 2020 04:50:59 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:23565 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726851AbgGNIu7 (ORCPT ); Tue, 14 Jul 2020 04:50:59 -0400 X-UUID: f42e069601354e08a7aa1eeba1a25f26-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=63syqxkiDARXC/86txfpZSfMUSpsIh5DHuOLV2ioXWM=; b=ivXEaD7aTGwtFAhsFM5/gCE6kbAqpli87c0Nmut0ygybOJLQNneKOo28pRNR4+vLQ/yloEh7q4nEkJ5oIBTYm/xLVwSsIVlltIYIQVYmvOvR2Bw0j6SsyePFeiFv3JLm1lybjaVV1LeYNp1wwCqJsTGjw0IOJrV7XPxAYoQ9yPc=; X-UUID: f42e069601354e08a7aa1eeba1a25f26-20200714 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1775630585; Tue, 14 Jul 2020 16:50:42 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:38 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:37 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 7/9] usb: gadget: bdc: avoid precedence issues Date: Tue, 14 Jul 2020 16:48:52 +0800 Message-ID: <1594716535-24699-7-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 234CA84F4DA467BBD83226F9F4C2428C3E8ACA56B98815F818F14044E06F47A72000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add () around macro argument to avoid precedence issues Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index 6940934..7b14af1 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -86,20 +86,20 @@ #define BDC_EPSTS5 0x74 #define BDC_EPSTS6 0x78 #define BDC_EPSTS7 0x7c -#define BDC_SRRBAL(n) (0x200 + (n * 0x10)) -#define BDC_SRRBAH(n) (0x204 + (n * 0x10)) -#define BDC_SRRINT(n) (0x208 + (n * 0x10)) -#define BDC_INTCTLS(n) (0x20c + (n * 0x10)) +#define BDC_SRRBAL(n) (0x200 + ((n) * 0x10)) +#define BDC_SRRBAH(n) (0x204 + ((n) * 0x10)) +#define BDC_SRRINT(n) (0x208 + ((n) * 0x10)) +#define BDC_INTCTLS(n) (0x20c + ((n) * 0x10)) /* Extended capability regs */ #define BDC_FSCNOC 0xcd4 #define BDC_FSCNIC 0xce4 -#define NUM_NCS(p) (p >> 28) +#define NUM_NCS(p) ((p) >> 28) /* Register bit fields and Masks */ /* BDC Configuration 0 */ #define BDC_PGS(p) (((p) & (0x7 << 8)) >> 8) -#define BDC_SPB(p) (p & 0x7) +#define BDC_SPB(p) ((p) & 0x7) /* BDC Capability1 */ #define BDC_P64 (1 << 0) @@ -113,7 +113,7 @@ #define BDC_CMD_DVC 0x1 #define BDC_CMD_CWS (0x1 << 5) #define BDC_CMD_CST(p) (((p) & (0xf << 6)) >> 6) -#define BDC_CMD_EPN(p) ((p & 0x1f) << 10) +#define BDC_CMD_EPN(p) (((p) & 0x1f) << 10) #define BDC_SUB_CMD_ADD (0x1 << 17) #define BDC_SUB_CMD_FWK (0x4 << 17) /* Reset sequence number */ @@ -163,7 +163,7 @@ #define BDC_SPEED_HS 0x3 #define BDC_SPEED_SS 0x4 -#define BDC_PST(p) (p & 0xf) +#define BDC_PST(p) ((p) & 0xf) #define BDC_PST_MASK 0xf /* USPPMS */ @@ -228,7 +228,7 @@ /* status report defines */ #define SR_XSF 0 #define SR_USPC 4 -#define SR_BD_LEN(p) (p & 0xffffff) +#define SR_BD_LEN(p) ((p) & 0xffffff) #define XSF_SUCC 0x1 #define XSF_SHORT 0x3 From patchwork Tue Jul 14 08:48:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D74CC1392 for ; Tue, 14 Jul 2020 08:51:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B73F9221EB for ; Tue, 14 Jul 2020 08:51:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="On8JRaZU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbgGNIu7 (ORCPT ); Tue, 14 Jul 2020 04:50:59 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:54529 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726944AbgGNIuy (ORCPT ); Tue, 14 Jul 2020 04:50:54 -0400 X-UUID: d888fa2ff88342f180633906b4bf78c0-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=igiyyVDf3nf9NsBHw9NIhqpD1Pbqqsb9AXDuJP0mwKw=; b=On8JRaZUvFPwhNQr9BUQFy+xPbda8iN+9KY1/5nMow1gCtztDdJObluHVSSFh8I6IYD29k81fPTA8OHa9kcpDu+wCFKAN8MvWfbqKhjFouMynH0faYIhc83eX5lKWIrCSb8Dophbjm+t//hYV80qmJUQIoyFLYow3TN19hrawTI=; X-UUID: d888fa2ff88342f180633906b4bf78c0-20200714 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1312977181; Tue, 14 Jul 2020 16:50:42 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:40 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:39 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 8/9] usb: gadget: bdc: use the BIT macro to define bit filed Date: Tue, 14 Jul 2020 16:48:53 +0800 Message-ID: <1594716535-24699-8-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: D6B5553F46369B693A548D6D9B252918F9FAF9AC49D95F91AE50CCB00B8528CB2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Prefer using the BIT macro to define bit fileds Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc.h | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc.h b/drivers/usb/gadget/udc/bdc/bdc.h index 7b14af1..de850ce 100644 --- a/drivers/usb/gadget/udc/bdc/bdc.h +++ b/drivers/usb/gadget/udc/bdc/bdc.h @@ -102,7 +102,7 @@ #define BDC_SPB(p) ((p) & 0x7) /* BDC Capability1 */ -#define BDC_P64 (1 << 0) +#define BDC_P64 BIT(0) /* BDC Command register */ #define BDC_CMD_FH 0xe @@ -111,7 +111,7 @@ #define BDC_CMD_BLA 0x3 #define BDC_CMD_EPC 0x2 #define BDC_CMD_DVC 0x1 -#define BDC_CMD_CWS (0x1 << 5) +#define BDC_CMD_CWS BIT(5) #define BDC_CMD_CST(p) (((p) & (0xf << 6)) >> 6) #define BDC_CMD_EPN(p) (((p) & 0x1f) << 10) #define BDC_SUB_CMD_ADD (0x1 << 17) @@ -124,7 +124,7 @@ #define BDC_SUB_CMD_EP_STP (0x2 << 17) #define BDC_SUB_CMD_EP_STL (0x4 << 17) #define BDC_SUB_CMD_EP_RST (0x1 << 17) -#define BDC_CMD_SRD (1 << 27) +#define BDC_CMD_SRD BIT(27) /* CMD completion status */ #define BDC_CMDS_SUCC 0x1 @@ -141,19 +141,19 @@ #define EPM_SHIFT 4 /* BDC USPSC */ -#define BDC_VBC (1 << 31) -#define BDC_PRC (1 << 30) -#define BDC_PCE (1 << 29) -#define BDC_CFC (1 << 28) -#define BDC_PCC (1 << 27) -#define BDC_PSC (1 << 26) -#define BDC_VBS (1 << 25) -#define BDC_PRS (1 << 24) -#define BDC_PCS (1 << 23) +#define BDC_VBC BIT(31) +#define BDC_PRC BIT(30) +#define BDC_PCE BIT(29) +#define BDC_CFC BIT(28) +#define BDC_PCC BIT(27) +#define BDC_PSC BIT(26) +#define BDC_VBS BIT(25) +#define BDC_PRS BIT(24) +#define BDC_PCS BIT(23) #define BDC_PSP(p) (((p) & (0x7 << 20)) >> 20) -#define BDC_SCN (1 << 8) -#define BDC_SDC (1 << 7) -#define BDC_SWS (1 << 4) +#define BDC_SCN BIT(8) +#define BDC_SDC BIT(7) +#define BDC_SWS BIT(4) #define BDC_USPSC_RW (BDC_SCN | BDC_SDC | BDC_SWS | 0xf) #define BDC_PSP(p) (((p) & (0x7 << 20)) >> 20) @@ -167,17 +167,17 @@ #define BDC_PST_MASK 0xf /* USPPMS */ -#define BDC_U2E (0x1 << 31) -#define BDC_U1E (0x1 << 30) -#define BDC_U2A (0x1 << 29) -#define BDC_PORT_W1S (0x1 << 17) +#define BDC_U2E BIT(31) +#define BDC_U1E BIT(30) +#define BDC_U2A BIT(29) +#define BDC_PORT_W1S BIT(17) #define BDC_U1T(p) ((p) & 0xff) #define BDC_U2T(p) (((p) & 0xff) << 8) #define BDC_U1T_MASK 0xff /* USBPM2 */ /* Hardware LPM Enable */ -#define BDC_HLE (1 << 16) +#define BDC_HLE BIT(16) /* BDC Status and Control */ #define BDC_COP_RST (1 << 29) @@ -186,11 +186,11 @@ #define BDC_COP_MASK (BDC_COP_RST | BDC_COP_RUN | BDC_COP_STP) -#define BDC_COS (1 << 28) +#define BDC_COS BIT(28) #define BDC_CSTS(p) (((p) & (0x7 << 20)) >> 20) -#define BDC_MASK_MCW (1 << 7) -#define BDC_GIE (1 << 1) -#define BDC_GIP (1 << 0) +#define BDC_MASK_MCW BIT(7) +#define BDC_GIE BIT(1) +#define BDC_GIP BIT(0) #define BDC_HLT 1 #define BDC_NOR 2 @@ -201,19 +201,19 @@ #define BD_CHAIN 0xf #define BD_TFS_SHIFT 4 -#define BD_SOT (1 << 26) -#define BD_EOT (1 << 27) -#define BD_ISP (1 << 29) -#define BD_IOC (1 << 30) -#define BD_SBF (1 << 31) +#define BD_SOT BIT(26) +#define BD_EOT BIT(27) +#define BD_ISP BIT(29) +#define BD_IOC BIT(30) +#define BD_SBF BIT(31) #define BD_INTR_TARGET(p) (((p) & 0x1f) << 27) -#define BDC_SRR_RWS (1 << 4) -#define BDC_SRR_RST (1 << 3) -#define BDC_SRR_ISR (1 << 2) -#define BDC_SRR_IE (1 << 1) -#define BDC_SRR_IP (1 << 0) +#define BDC_SRR_RWS BIT(4) +#define BDC_SRR_RST BIT(3) +#define BDC_SRR_ISR BIT(2) +#define BDC_SRR_IE BIT(1) +#define BDC_SRR_IP BIT(0) #define BDC_SRR_EPI(p) (((p) & (0xff << 24)) >> 24) #define BDC_SRR_DPI(p) (((p) & (0xff << 16)) >> 16) #define BDC_SRR_DPI_MASK 0x00ff0000 @@ -221,7 +221,7 @@ #define MARK_CHAIN_BD (BD_CHAIN | BD_EOT | BD_SOT) /* Control transfer BD specific fields */ -#define BD_DIR_IN (1 << 25) +#define BD_DIR_IN BIT(25) #define BDC_PTC_MASK 0xf0000000 @@ -241,13 +241,13 @@ /* Transfer BD fields */ #define BD_LEN(p) ((p) & 0x1ffff) -#define BD_LTF (1 << 25) +#define BD_LTF BIT(25) #define BD_TYPE_DS 0x1 #define BD_TYPE_SS 0x2 -#define BDC_EP_ENABLED (1 << 0) -#define BDC_EP_STALL (1 << 1) -#define BDC_EP_STOP (1 << 2) +#define BDC_EP_ENABLED BIT(0) +#define BDC_EP_STALL BIT(1) +#define BDC_EP_STOP BIT(2) /* One BD can transfer max 65536 bytes */ #define BD_MAX_BUFF_SIZE (1 << 16) @@ -266,9 +266,9 @@ /* FUNCTION WAKE DEV NOTIFICATION interval, USB3 spec table 8.13 */ #define BDC_TNOTIFY 2500 /*in ms*/ /* Devstatus bitfields */ -#define REMOTE_WAKEUP_ISSUED (1 << 16) -#define DEVICE_SUSPENDED (1 << 17) -#define FUNC_WAKE_ISSUED (1 << 18) +#define REMOTE_WAKEUP_ISSUED BIT(16) +#define DEVICE_SUSPENDED BIT(17) +#define FUNC_WAKE_ISSUED BIT(18) #define REMOTE_WAKE_ENABLE (1 << USB_DEVICE_REMOTE_WAKEUP) /* On disconnect, preserve these bits and clear rest */ From patchwork Tue Jul 14 08:48:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11661981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D42F1392 for ; Tue, 14 Jul 2020 08:50:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83CC8221EB for ; Tue, 14 Jul 2020 08:50:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="WxhM0PJM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbgGNIuz (ORCPT ); Tue, 14 Jul 2020 04:50:55 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:54529 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726437AbgGNIuw (ORCPT ); Tue, 14 Jul 2020 04:50:52 -0400 X-UUID: e1eb7e2aa578486db4ba4a9c4546aef5-20200714 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=7ze8MUqRCqW8NAFyPQx+TiTtPZUYUkBO979o7vg+Kok=; b=WxhM0PJM8r5yEmzZQTcAECnTzqfIYKOPvt2/NvdsvgroEMpYjWli+385jQhqIo3ng0OCe1Aq1+KoMxmNDMgUJE6HQvvU6y0iMljKWxsmbPAym7EEpGEX9RHfjCeYqLLnHlFsebOEQ9GNhp3jDJojjdSVFfAVfE4h4+GrxIlSYsQ=; X-UUID: e1eb7e2aa578486db4ba4a9c4546aef5-20200714 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 697251406; Tue, 14 Jul 2020 16:50:43 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 14 Jul 2020 16:50:41 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 14 Jul 2020 16:50:40 +0800 From: Chunfeng Yun To: Felipe Balbi , Florian Fainelli CC: Greg Kroah-Hartman , Matthias Brugger , YueHaibing , Stephen Boyd , Chunfeng Yun , , , , Subject: [PATCH 9/9] usb: gadget: bdc: prefer pointer dereference to pointer type Date: Tue, 14 Jul 2020 16:48:54 +0800 Message-ID: <1594716535-24699-9-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> References: <1594716535-24699-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: C2E4303C8A8616C9F37FBD7111587A0843CFAC8B0C6422BCC7485C4D614E0B692000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Prefer kzalloc(sizeof(*bd_table)...) over kzalloc(sizeof(struct bd_table) Signed-off-by: Chunfeng Yun --- drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index eea66d5..d1ace77 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@ -147,7 +147,7 @@ static int ep_bd_list_alloc(struct bdc_ep *ep) /* Allocate memory for each table */ for (index = 0; index < num_tabs; index++) { /* Allocate memory for bd_table structure */ - bd_table = kzalloc(sizeof(struct bd_table), GFP_ATOMIC); + bd_table = kzalloc(sizeof(*bd_table), GFP_ATOMIC); if (!bd_table) goto fail;