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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090302223916.GA31381@kroah.com>
Date:	Mon, 2 Mar 2009 14:39:16 -0800
From:	Greg KH <greg@...ah.com>
To:	Mike Murphy <mamurph@...clemson.edu>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
	linux-usb@...r.kernel.org, oliver@...kum.org, fweisbec@...il.com,
	torvalds@...ux-foundation.org
Subject: Re: PATCH [1/3] drivers/input/xpad.c: Improve Xbox 360 wireless
	support and add sysfs interface

On Mon, Mar 02, 2009 at 04:59:48PM -0500, Mike Murphy wrote:
> As I was coding this interface, I found myself wishing for a
> macro-based system like module parameters have. For example, it would
> be nice to be able to do something like the following:
> 
> DECLARE_SYSFS_INTERFACE(&xpad->dead_zone, uint, &check_dead_zone);
> 
> which would create the needed show/store functions that worked with an
> unsigned int. The check_dead_zone function would be a validator
> function inside the module that would check the validity on a
> user-supplied value on store (in this case, to be sure it was at least
> 1024 below the stick limit) and return an error code if the value were
> out of range. Yes, the validator would be an extra function call, but
> this code doesn't run in an interrupt context, so the benefit of being
> able to centralize the functionality and simplify drivers might be
> worth the extra overhead.

I tried to create such an interface years ago, and the macro tricks
involved ended up being horrible, and in the end, it didn't work.  But
if you can come up with something, I'd love to see it.

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