Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea987ebc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: Fix multiple issues found by static analysis tool"

parents 2ade3b4a 13e72196
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ struct msm_usb_bam_platform_data {
 * @return 0 on success, negative value on error
 *
 */
int usb_bam_connect(u8 idx, u32 *bam_pipe_idx);
int usb_bam_connect(int idx, u32 *bam_pipe_idx);

/**
 * Connect USB-to-IPA SPS connection.
+3 −3
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static struct usb_bam_pipe_connect *usb_bam_connections;
static struct usb_bam_ctx_type ctx;
static struct usb_bam_hsic_host_info hsic_host_info;

static int __usb_bam_register_wake_cb(u8 idx, int (*callback)(void *user),
static int __usb_bam_register_wake_cb(int idx, int (*callback)(void *user),
	void *param, bool trigger_cb_per_pipe);
static void wait_for_prod_release(enum usb_bam cur_bam);

@@ -664,7 +664,7 @@ static void usb_bam_start_lpm(bool disconnect)

}

int usb_bam_connect(u8 idx, u32 *bam_pipe_idx)
int usb_bam_connect(int idx, u32 *bam_pipe_idx)
{
	int ret;
	struct usb_bam_pipe_connect *pipe_connect = &usb_bam_connections[idx];
@@ -2019,7 +2019,7 @@ static void usb_bam_ack_toggle_cb(void *priv,
	}
}

static int __usb_bam_register_wake_cb(u8 idx, int (*callback)(void *user),
static int __usb_bam_register_wake_cb(int idx, int (*callback)(void *user),
	void *param, bool trigger_cb_per_pipe)
{
	struct sps_pipe *pipe = ctx.usb_bam_sps.sps_pipes[idx];
+2 −2
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ static int dwc3_msm_dbm_ep_config(struct dwc3_msm *mdwc, u8 usb_ep, u8 bam_pipe,
				  bool producer, bool disable_wb,
				  bool internal_mem, bool ioc)
{
	u8 dbm_ep;
	int dbm_ep;
	u32 ep_cfg;

	dev_dbg(mdwc->dev, "%s\n", __func__);
@@ -564,7 +564,7 @@ static int dwc3_msm_dbm_ep_config(struct dwc3_msm *mdwc, u8 usb_ep, u8 bam_pipe,
 */
static int dwc3_msm_dbm_ep_unconfig(struct dwc3_msm *mdwc, u8 usb_ep)
{
	u8 dbm_ep;
	int dbm_ep;
	u32 data;

	dev_dbg(mdwc->dev, "%s\n", __func__);
+2 −2
Original line number Diff line number Diff line
@@ -456,7 +456,7 @@ static int gport_rmnet_connect(struct f_rmnet *dev)
			pr_err("%s: usb_bam_get_connection_idx failed\n",
				__func__);
			gsmd_ctrl_disconnect(&dev->port, port_num);
			return ret;
			return -EINVAL;
		}
	case USB_GADGET_XPORT_BAM:
		ret = gbam_connect(&dev->port, port_num,
@@ -477,7 +477,7 @@ static int gport_rmnet_connect(struct f_rmnet *dev)
			pr_err("%s: usb_bam_get_connection_idx failed\n",
				__func__);
			gsmd_ctrl_disconnect(&dev->port, port_num);
			return ret;
			return -EINVAL;
		}
		ret = gbam_connect(&dev->port, port_num,
			dxport, src_connection_idx, dst_connection_idx);
+6 −3
Original line number Diff line number Diff line
@@ -722,10 +722,15 @@ static int gs_alloc_requests(struct usb_ep *ep, struct list_head *head,
static int gs_start_io(struct gs_port *port)
{
	struct list_head	*head = &port->read_pool;
	struct usb_ep		*ep = port->port_usb->out;
	struct usb_ep		*ep;
	int			status;
	unsigned		started;

	if (!port->port_usb)
		return -EIO;

	ep = port->port_usb->out;

	/* Allocate RX and TX I/O buffers.  We can't easily do this much
	 * earlier (with GFP_KERNEL) because the requests are coupled to
	 * endpoints, as are the packet sizes we'll be using.  Different
@@ -748,8 +753,6 @@ static int gs_start_io(struct gs_port *port)
	port->n_read = 0;
	started = gs_start_rx(port);

	if (!port->port_usb)
		return -EIO;
	/* unblock any pending writes into our circular buffer */
	if (started) {
		tty_wakeup(port->port.tty);