From 47ea7558748fefc9f98bf691e4669c74c9a2c22c Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Sat, 29 Aug 2020 01:46:19 -0700 Subject: [PATCH 1/3] usb: gadget: qdss: Fix overlapping comparison operators The conditional check in qdss_enable_debug_inface_store() ensures that the user input is either a 1 or 0. However, the comparison check used has overlapping conditions, leading to a compile warning/error. Change the operators to check explicitly for 1 or 0 to avoid this. Change-Id: I582cd0ab56815b434818744f597f867fbf3abce2 Signed-off-by: Wesley Cheng --- drivers/usb/gadget/function/f_qdss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_qdss.c b/drivers/usb/gadget/function/f_qdss.c index 8c2d9b8dff20..92c3bfaaecba 100644 --- a/drivers/usb/gadget/function/f_qdss.c +++ b/drivers/usb/gadget/function/f_qdss.c @@ -1013,7 +1013,7 @@ static ssize_t qdss_enable_debug_inface_store(struct config_item *item, return len; } - if (kstrtou8(page, 0, &stats) != 0 && (stats != 0 || stats != 1)) { + if (kstrtou8(page, 0, &stats) != 0 && !(stats == 0 || stats == 1)) { pr_err("(%u)Wrong value. enter 0 to disable or 1 to enable.\n", stats); return len; From 077ffb878d0d52e8f3e0cc85284a885b2b39819d Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Sat, 29 Aug 2020 01:45:23 -0700 Subject: [PATCH 2/3] platform: msm: Export usb_bam symbols for module compilation Some symbols utilized by f_qdss are not exported, which leads to symbol undefined errors when compiling usb_bam as a module. Export the symbols remaining symbols used by f_qdss. Change-Id: I3f01cee19bbbc990487df4437e15c3c5aa2a98e5 Signed-off-by: Wesley Cheng --- drivers/platform/msm/usb_bam.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/platform/msm/usb_bam.c b/drivers/platform/msm/usb_bam.c index b2f004157375..bce3fe6bf168 100644 --- a/drivers/platform/msm/usb_bam.c +++ b/drivers/platform/msm/usb_bam.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved. */ #include @@ -445,6 +445,7 @@ int usb_bam_alloc_fifos(enum usb_ctrl cur_bam, u8 idx) } return 0; } +EXPORT_SYMBOL(usb_bam_alloc_fifos); int usb_bam_free_fifos(enum usb_ctrl cur_bam, u8 idx) { @@ -521,6 +522,7 @@ int usb_bam_free_fifos(enum usb_ctrl cur_bam, u8 idx) return 0; } +EXPORT_SYMBOL(usb_bam_free_fifos); static int connect_pipe(enum usb_ctrl cur_bam, u8 idx, u32 *usb_pipe_idx, unsigned long iova) @@ -635,6 +637,7 @@ int get_qdss_bam_info(enum usb_ctrl cur_bam, u8 idx, return 0; } +EXPORT_SYMBOL(get_qdss_bam_info); int usb_bam_connect(enum usb_ctrl cur_bam, int idx, u32 *bam_pipe_idx, unsigned long iova) @@ -691,6 +694,7 @@ int usb_bam_connect(enum usb_ctrl cur_bam, int idx, u32 *bam_pipe_idx, return 0; } +EXPORT_SYMBOL(usb_bam_connect); int usb_bam_get_pipe_type(enum usb_ctrl bam_type, u8 idx, enum usb_bam_pipe_type *type) @@ -945,6 +949,7 @@ int usb_bam_disconnect_pipe(enum usb_ctrl bam_type, u8 idx) return 0; } +EXPORT_SYMBOL(usb_bam_disconnect_pipe); static void usb_bam_sps_events(enum sps_callback_case sps_cb_case, void *user) { From b0b5ab3932f447d3a43f929fbc568d87e51ab70f Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Sat, 29 Aug 2020 02:01:04 -0700 Subject: [PATCH 3/3] usb: dwc3: dwc3-msm: Export msm_data_fifo_config() for QDSS Since f_qdss is compiled as a module, it is dependent on msm_data_fifo_config() being exported to avoid an undefined reference compilation error. Change-Id: I41155fe7af14c8e4003841f54ef878d3535d33d7 Signed-off-by: Wesley Cheng --- drivers/usb/dwc3/dwc3-msm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index c7a8601c0010..9cb26af410c4 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -779,6 +779,7 @@ int msm_data_fifo_config(struct usb_ep *ep, unsigned long addr, return 0; } +EXPORT_SYMBOL(msm_data_fifo_config); static int dbm_ep_unconfig(struct dwc3_msm *mdwc, u8 usb_ep);