lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ