mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 22:05:08 +00:00
staging: emxx_udc: Remove unnecessary NULL checks
These pointers can't be NULL so I have removed the checks. The checking was sort of problematic as well because it didn't make sense. In _nbu2ss_read_request_data() the && should have been ||. In nbu2ss_gad_get_frame() we know that "pgadget" is non-NULL and "udc" is an offset from "pgadget" so it can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0defb439fc
commit
716003bb8b
@ -1672,9 +1672,6 @@ static int std_req_set_configuration(struct nbu2ss_udc *udc)
|
|||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
static inline void _nbu2ss_read_request_data(struct nbu2ss_udc *udc, u32 *pdata)
|
static inline void _nbu2ss_read_request_data(struct nbu2ss_udc *udc, u32 *pdata)
|
||||||
{
|
{
|
||||||
if ((!udc) && (!pdata))
|
|
||||||
return;
|
|
||||||
|
|
||||||
*pdata = _nbu2ss_readl(&udc->p_regs->SETUP_DATA0);
|
*pdata = _nbu2ss_readl(&udc->p_regs->SETUP_DATA0);
|
||||||
pdata++;
|
pdata++;
|
||||||
*pdata = _nbu2ss_readl(&udc->p_regs->SETUP_DATA1);
|
*pdata = _nbu2ss_readl(&udc->p_regs->SETUP_DATA1);
|
||||||
@ -2941,11 +2938,6 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
|
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
|
||||||
if (!udc) {
|
|
||||||
dev_err(&pgadget->dev, "%s, udc == NULL\n", __func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
data = gpio_get_value(VBUS_VALUE);
|
data = gpio_get_value(VBUS_VALUE);
|
||||||
if (data == 0)
|
if (data == 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user