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]
Message-ID: <20120427192900.GA14158@kroah.com>
Date:	Fri, 27 Apr 2012 12:29:00 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	H Hartley Sweeten <hartleys@...ionengravers.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	devel@...verdev.osuosl.org, fmhess@...rs.sourceforge.net,
	abbotti@....co.uk
Subject: Re: [PATCH] staging: comedi: introduce 'comedi_get_board' helper
 function

On Fri, Apr 27, 2012 at 11:49:48AM -0700, H Hartley Sweeten wrote:
> This helper function is used to fetch the comedi_device board_ptr
> which is used during the attach to pass board specific information
> to the comedi drivers.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
> Cc: Ian Abbott <abbotti@....co.uk>
> Cc: Mori Hess <fmhess@...rs.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> 
> ---
> 
> With this helper removing all the 'this_board' defines in the drivers
> will be easier (and cleaner).
> 
> diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
> index 300fd84..53a05dd 100644
> --- a/drivers/staging/comedi/comedidev.h
> +++ b/drivers/staging/comedi/comedidev.h
> @@ -235,6 +235,11 @@ struct comedi_device {
>  	void (*close) (struct comedi_device *dev);
>  };
>  
> +static inline const void *comedi_get_board(struct comedi_device *dev)
> +{
> +	return dev->board_ptr;
> +}

"traditionally" the *get* functions increment a reference count of the
pointer it returns, which isn't happening here.

How about renaming this to just be comedi_board() instead?

thanks,

greg k-h
--
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