RS485 on Cris: use global value of TIOCSRS485
PATCH 1/1 RS485 on Cris: use global value of TIOCSRS485
Hi Jesper, Hi Mikael,
the following patch sets the value of TIOCSRS485 on Cris
equal to the value of all other architectures (as currently is for TIOCGRS485).
With this patch, TIOCSRS485 gets the same value across all architectures, making maintenance and portability of user-level code easier.
Best regards,
Claudio
RS485: use global value of TIOCSRS485 (i.e. 0x546F) on Cris.
--- arch/cris/include/asm/ioctls.h | 2 +- drivers/serial/crisv10.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)
arch/cris/include/asm/ioctls.h +1 -1
@@ -4,7 +4,7 @@#define TIOCSERGSTRUCT 0x5458/* For debugging only */ #define TIOCSERSETRS485 0x5461/* enable rs-485 (deprecated) */ #define TIOCSERWRRS485 0x5462/* write rs-485 */ -#define TIOCSRS485 0x5463/* enable rs-485 */ +#define TIOCSRS485DEPR 0x5463/* enable rs-485 (deprecated) */ #include <asm-generic/ioctls.h>
drivers/serial/crisv10.c +5 -0
@@ -3717,6 +3717,11 @@ rs_ioctl(struct tty_struct *tty, struct file * file,return e100_enable_rs485 (tty, &rs485data); } +case TIOCSRS485DEPR : + { +printk (KERN_DEBUG "The use of this ioctl is deprecated. Use TIOCSRS485 instead\n" ); +/* Fall through */ + }case TIOCSRS485 : {/* This is the new version of TIOCSRS485, with new
Signature · 1 line
1.7.1
Alan Cox
NAKQuoted 3 lines
With this patch, TIOCSRS485 gets the same value across all architectures, making maintenance and portability of user-level code easier.
I don't see why this is worth doing - no application code should ever hardcode the value.
drivers/serial/crisv10.c rs_ioctl(struct tty_struct *tty, struct file * file, · line 3724
Quoted 5 lines
drivers/serial/crisv10.c +5
-0+case TIOCSRS485DEPR : + { +printk (KERN_DEBUG "The use of this ioctl is deprecated. Use TIOCSRS485 instead\n" ); +/* Fall through */ + }
and letting everyone spew printks is not a good thing.
NAK
Il 06/01/2011 14:34, Alan Cox ha scritto:
Quoted 6 lines
Quoted 3 lines
With this patch, TIOCSRS485 gets the same value across all architectures, making maintenance and portability of user-level code easier.
I don't see why this is worth doing - no application code should ever hardcode the value.
I'm afraid this is true only in a theoretical world. But I hope I'm wrong.
Actually, I can't see any reason to keep different values of TIOCSRS485 in the kernel code when we can have a single value across all architectures.
But I trust your judgment: if you say it's not worth doing, let's avoid it.
Many thanks,
Claudio