Re: [PATCH 09/11] usb: musb: break the huge isr musb_stage0_irq() into small functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.17-rc1 next-20180417]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bin-Liu/usb-musb-cleanup/20180417-133633
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next

smatch warnings:
drivers/usb/musb/musb_core.c:797 musb_handle_intr_connect() error: we previously assumed 'musb->hcd' could be null (see line 783)

# https://github.com/0day-ci/linux/commit/92be75b4fb79173759af42e50a81d0020e945c1e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 92be75b4fb79173759af42e50a81d0020e945c1e
vim +797 drivers/usb/musb/musb_core.c

1c25fda4a Arnaud Mandy              2009-12-28  745  
92be75b4f Bin Liu                   2018-04-16  746  static void musb_handle_intr_connect(struct musb *musb, u8 devctl, u8 int_usb)
92be75b4f Bin Liu                   2018-04-16  747  {
8b125df5b Daniel Mack               2013-04-10  748  	struct usb_hcd *hcd = musb->hcd;
550a7375f Felipe Balbi              2008-07-24  749  
550a7375f Felipe Balbi              2008-07-24  750  	musb->is_active = 1;
550a7375f Felipe Balbi              2008-07-24  751  	musb->ep0_stage = MUSB_EP0_START;
550a7375f Felipe Balbi              2008-07-24  752  
b18d26f6a Sebastian Andrzej Siewior 2012-10-30  753  	musb->intrtxe = musb->epmask;
b18d26f6a Sebastian Andrzej Siewior 2012-10-30  754  	musb_writew(musb->mregs, MUSB_INTRTXE, musb->intrtxe);
af5ec14d4 Sebastian Andrzej Siewior 2012-10-30  755  	musb->intrrxe = musb->epmask & 0xfffe;
af5ec14d4 Sebastian Andrzej Siewior 2012-10-30  756  	musb_writew(musb->mregs, MUSB_INTRRXE, musb->intrrxe);
d709d22ee Ajay Kumar Gupta          2010-07-08  757  	musb_writeb(musb->mregs, MUSB_INTRUSBE, 0xf7);
550a7375f Felipe Balbi              2008-07-24  758  	musb->port1_status &= ~(USB_PORT_STAT_LOW_SPEED
550a7375f Felipe Balbi              2008-07-24  759  				|USB_PORT_STAT_HIGH_SPEED
550a7375f Felipe Balbi              2008-07-24  760  				|USB_PORT_STAT_ENABLE
550a7375f Felipe Balbi              2008-07-24  761  				);
550a7375f Felipe Balbi              2008-07-24  762  	musb->port1_status |= USB_PORT_STAT_CONNECTION
550a7375f Felipe Balbi              2008-07-24  763  				|(USB_PORT_STAT_C_CONNECTION << 16);
550a7375f Felipe Balbi              2008-07-24  764  
550a7375f Felipe Balbi              2008-07-24  765  	/* high vs full speed is just a guess until after reset */
550a7375f Felipe Balbi              2008-07-24  766  	if (devctl & MUSB_DEVCTL_LSDEV)
550a7375f Felipe Balbi              2008-07-24  767  		musb->port1_status |= USB_PORT_STAT_LOW_SPEED;
550a7375f Felipe Balbi              2008-07-24  768  
550a7375f Felipe Balbi              2008-07-24  769  	/* indicate new connection to OTG machine */
e47d92545 Antoine Tenart            2014-10-30  770  	switch (musb->xceiv->otg->state) {
550a7375f Felipe Balbi              2008-07-24  771  	case OTG_STATE_B_PERIPHERAL:
550a7375f Felipe Balbi              2008-07-24  772  		if (int_usb & MUSB_INTR_SUSPEND) {
b99d3659b Bin Liu                   2016-06-30  773  			musb_dbg(musb, "HNP: SUSPEND+CONNECT, now b_host");
550a7375f Felipe Balbi              2008-07-24  774  			int_usb &= ~MUSB_INTR_SUSPEND;
1de00dae8 David Brownell            2009-04-02  775  			goto b_host;
550a7375f Felipe Balbi              2008-07-24  776  		} else
b99d3659b Bin Liu                   2016-06-30  777  			musb_dbg(musb, "CONNECT as b_peripheral???");
550a7375f Felipe Balbi              2008-07-24  778  		break;
550a7375f Felipe Balbi              2008-07-24  779  	case OTG_STATE_B_WAIT_ACON:
b99d3659b Bin Liu                   2016-06-30  780  		musb_dbg(musb, "HNP: CONNECT, now b_host");
1de00dae8 David Brownell            2009-04-02  781  b_host:
e47d92545 Antoine Tenart            2014-10-30  782  		musb->xceiv->otg->state = OTG_STATE_B_HOST;
74c2e9360 Daniel Mack               2013-04-10 @783  		if (musb->hcd)
74c2e9360 Daniel Mack               2013-04-10  784  			musb->hcd->self.is_b_host = 1;
1de00dae8 David Brownell            2009-04-02  785  		del_timer(&musb->otg_timer);
550a7375f Felipe Balbi              2008-07-24  786  		break;
550a7375f Felipe Balbi              2008-07-24  787  	default:
550a7375f Felipe Balbi              2008-07-24  788  		if ((devctl & MUSB_DEVCTL_VBUS)
550a7375f Felipe Balbi              2008-07-24  789  				== (3 << MUSB_DEVCTL_VBUS_SHIFT)) {
e47d92545 Antoine Tenart            2014-10-30  790  			musb->xceiv->otg->state = OTG_STATE_A_HOST;
0b3eba442 Daniel Mack               2013-04-10  791  			if (hcd)
550a7375f Felipe Balbi              2008-07-24  792  				hcd->self.is_b_host = 0;
550a7375f Felipe Balbi              2008-07-24  793  		}
550a7375f Felipe Balbi              2008-07-24  794  		break;
550a7375f Felipe Balbi              2008-07-24  795  	}
1de00dae8 David Brownell            2009-04-02  796  
0b3eba442 Daniel Mack               2013-04-10 @797  	musb_host_poke_root_hub(musb);
1de00dae8 David Brownell            2009-04-02  798  
b99d3659b Bin Liu                   2016-06-30  799  	musb_dbg(musb, "CONNECT (%s) devctl %02x",
e47d92545 Antoine Tenart            2014-10-30  800  			usb_otg_state_string(musb->xceiv->otg->state), devctl);
550a7375f Felipe Balbi              2008-07-24  801  }
550a7375f Felipe Balbi              2008-07-24  802  


---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux