sgi-gru: decrapfiy options_write() function
commit42d7bdfc3320039bb9310703d6475a62f5c74772
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Nov 2009 18:48:30 +0000 (5 10:48 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:42 +0000 (9 16:22 -0800)
tree47007c83ae72a02b70201f1177623e898eef4efb
parent9416d12bcaa77126bd55f7df2cb4e78b711f97bd
sgi-gru: decrapfiy options_write() function

commit d39b7dd1dcbf394a1cb897457c862dafe9a20ac5 upstream.

Not a single line of actual code in the function was really
fundamentally correct.

Problems ranged from lack of proper range checking, to removing the last
character written (which admittedly is usually '\n'), to not accepting
hex numbers even though the 'show' routine would show the data in that
format.

This tries to do better.

Acked-by: Michael Buesch <mb@bu3sch.de>
Tested-and-acked-by: Jack Steiner <steiner@sgi.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Michael Gilbert <michael.s.gilbert@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/misc/sgi-gru/gruprocfs.c