* [PATCH] RS485 on Cris: use global value of TIOCSRS485
@ 2011-01-06 8:25 Claudio Scordino
2011-01-06 13:34 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Claudio Scordino @ 2011-01-06 8:25 UTC (permalink / raw)
To: starvik, Jesper Nilsson
Cc: linux-cris-kernel, linux-serial@vger.kernel.org, Linux Kernel
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.
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
---
arch/cris/include/asm/ioctls.h | 2 +-
drivers/serial/crisv10.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/cris/include/asm/ioctls.h b/arch/cris/include/asm/ioctls.h
index 488fbb3..2c15ff8 100644
--- a/arch/cris/include/asm/ioctls.h
+++ b/arch/cris/include/asm/ioctls.h
@@ -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>
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index bcc31f2..29bd418 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RS485 on Cris: use global value of TIOCSRS485
2011-01-06 8:25 [PATCH] RS485 on Cris: use global value of TIOCSRS485 Claudio Scordino
@ 2011-01-06 13:34 ` Alan Cox
2011-01-06 16:58 ` Claudio Scordino
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2011-01-06 13:34 UTC (permalink / raw)
To: Claudio Scordino
Cc: starvik, Jesper Nilsson, linux-cris-kernel,
linux-serial@vger.kernel.org, Linux Kernel
> 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.
> + 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RS485 on Cris: use global value of TIOCSRS485
2011-01-06 13:34 ` Alan Cox
@ 2011-01-06 16:58 ` Claudio Scordino
0 siblings, 0 replies; 3+ messages in thread
From: Claudio Scordino @ 2011-01-06 16:58 UTC (permalink / raw)
To: Alan Cox
Cc: starvik, Jesper Nilsson, linux-cris-kernel,
linux-serial@vger.kernel.org, Linux Kernel
Il 06/01/2011 14:34, Alan Cox ha scritto:
>> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-06 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 8:25 [PATCH] RS485 on Cris: use global value of TIOCSRS485 Claudio Scordino
2011-01-06 13:34 ` Alan Cox
2011-01-06 16:58 ` Claudio Scordino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).