[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B080620.5050500@math.u-psud.fr>
Date: Sat, 21 Nov 2009 16:24:16 +0100
From: Duncan Sands <duncan.sands@...h.u-psud.fr>
To: Simon Arlott <simon@...e.lp0.eu>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH 3/8] cxacru: check device isn't being removed during sysfs
calls
Hi Simon,
> +static inline void *to_usbatm_driver_data(struct usb_interface *intf)
> +{
> + struct usbatm_data *usbatm_instance;
> +
> + if (intf == NULL)
> + return NULL;
> +
> + usbatm_instance = usb_get_intfdata(intf);
> +
> + if (usbatm_instance == NULL) /* set NULL before unbind() */
> + return NULL;
> +
> + return usbatm_instance->driver_data; /* set NULL after unbind() */
> +}
> +
> +static inline void *to_usbatm_atm_dev(struct usb_interface *intf)
> +{
> + struct usbatm_data *usbatm_instance;
> +
> + if (intf == NULL)
> + return NULL;
> +
> + usbatm_instance = usb_get_intfdata(intf);
> +
> + if (usbatm_instance == NULL) /* set NULL before unbind() */
> + return NULL;
> +
> + return usbatm_instance->atm_dev; /* set NULL after unbind() */
> +}
> +
why not collapse these two into one that just returns usbatm_instance,
and have users extract the ->driver_data or ->atm_dev fields?
Ciao,
Duncan.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists