Commit 872ce511 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Felipe Balbi
Browse files

usb: gadget: fix unused-but-set-variale warnings



Those are enabled with W=1 make option.

The patch leaves of some type-limits warnings which are caused by
generic macros used in a way where they produce always-false
conditions.

Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 9522def4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2227,8 +2227,8 @@ static int __ffs_data_got_strings(struct ffs_data *ffs,
{
	u32 str_count, needed_count, lang_count;
	struct usb_gadget_strings **stringtabs, *t;
	struct usb_string *strings, *s;
	const char *data = _data;
	struct usb_string *s;

	ENTER();

@@ -2286,7 +2286,6 @@ static int __ffs_data_got_strings(struct ffs_data *ffs,
		stringtabs = vla_ptr(vlabuf, d, stringtabs);
		t = vla_ptr(vlabuf, d, stringtab);
		s = vla_ptr(vlabuf, d, strings);
		strings = s;
	}

	/* For each language */
+1 −2
Original line number Diff line number Diff line
@@ -907,7 +907,6 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count)
{
	struct gs_port	*port = tty->driver_data;
	unsigned long	flags;
	int		status;

	pr_vdebug("gs_write: ttyGS%d (%p) writing %d bytes\n",
			port->port_num, tty, count);
@@ -917,7 +916,7 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count)
		count = gs_buf_put(&port->port_write_buf, buf, count);
	/* treat count == 0 as flush_chars() */
	if (port->port_usb)
		status = gs_start_tx(port);
		gs_start_tx(port);
	spin_unlock_irqrestore(&port->port_lock, flags);

	return count;
+6 −9
Original line number Diff line number Diff line
@@ -347,17 +347,14 @@ static int gfs_bind(struct usb_composite_dev *cdev)

#ifdef CONFIG_USB_FUNCTIONFS_RNDIS
	{
		struct f_rndis_opts *rndis_opts;

		fi_rndis = usb_get_function_instance("rndis");
		if (IS_ERR(fi_rndis)) {
			ret = PTR_ERR(fi_rndis);
			goto error;
		}
		rndis_opts = container_of(fi_rndis, struct f_rndis_opts,
					  func_inst);
#ifndef CONFIG_USB_FUNCTIONFS_ETH
		net = rndis_opts->net;
		net = container_of(fi_rndis, struct f_rndis_opts,
				   func_inst)->net;
#endif
	}
#endif
+1 −8
Original line number Diff line number Diff line
@@ -2340,7 +2340,6 @@ static irqreturn_t udc_data_in_isr(struct udc *dev, int ep_ix)
	struct udc_ep *ep;
	struct udc_request *req;
	struct udc_data_dma *td;
	unsigned dma_done;
	unsigned len;

	ep = &dev->ep[ep_ix];
@@ -2385,13 +2384,8 @@ static irqreturn_t udc_data_in_isr(struct udc *dev, int ep_ix)
			 */
			if (use_dma_ppb_du) {
				td = udc_get_last_dma_desc(req);
				if (td) {
					dma_done =
						AMD_GETBITS(td->status,
						UDC_DMA_IN_STS_BS);
					/* don't care DMA done */
				if (td)
					req->req.actual = req->req.length;
				}
			} else {
				/* assume all bytes transferred */
				req->req.actual = req->req.length;
@@ -3417,4 +3411,3 @@ module_pci_driver(udc_pci_driver);
MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION);
MODULE_AUTHOR("Thomas Dahlmann");
MODULE_LICENSE("GPL");
+0 −3
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ static int bdc_submit_cmd(struct bdc *bdc, u32 cmd_sc,
					u32 param0, u32 param1,	u32 param2)
{
	u32 temp, cmd_status;
	int reset_bdc = 0;
	int ret;

	temp = bdc_readl(bdc->regs, BDC_CMDSC);
@@ -94,7 +93,6 @@ static int bdc_submit_cmd(struct bdc *bdc, u32 cmd_sc,

	case BDC_CMDS_INTL:
		dev_err(bdc->dev, "BDC Internal error\n");
		reset_bdc = 1;
		ret = -ECONNRESET;
		break;

@@ -102,7 +100,6 @@ static int bdc_submit_cmd(struct bdc *bdc, u32 cmd_sc,
		dev_err(bdc->dev,
			"command timedout waited for %dusec\n",
			BDC_CMD_TIMEOUT);
		reset_bdc = 1;
		ret = -ECONNRESET;
		break;
	default:
Loading