linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] serial: max310x: Fix build error
@ 2014-02-13 19:12 Alexander Shiyan
  0 siblings, 0 replies; only message in thread
From: Alexander Shiyan @ 2014-02-13 19:12 UTC (permalink / raw)
  To: linux-serial; +Cc: Greg Kroah-Hartman, Jiri Slaby, Alexander Shiyan

This is a temporary solution to fix following issue:
config: make ARCH=alpha allyesconfig

All error/warnings:

 drivers/tty/serial/max310x.c: In function 'max310x_ioctl':
>> drivers/tty/serial/max310x.c:905:7: error: 'TIOCSRS485' undeclared (first use in this function)
 drivers/tty/serial/max310x.c:905:7: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/tty/serial/max310x.c:906:3: error: implicit declaration of function 'copy_from_user' [-Werror=implicit-function-declaration]
>> drivers/tty/serial/max310x.c:929:7: error: 'TIOCGRS485' undeclared (first use in this function)
>> drivers/tty/serial/max310x.c:938:3: error: implicit declaration of function 'copy_to_user' [-Werror=implicit-function-declaration]
 cc1: some warnings being treated as errors

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
Greg, this is a v2, so please revert previous fix first.
Sorry for noise. Thanks.
---
 drivers/tty/serial/max310x.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index 8a035d6..38d2fae 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -876,6 +876,7 @@ static void max310x_set_termios(struct uart_port *port,
 static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
 			 unsigned long arg)
 {
+#if defined(TIOCSRS485) && defined(TIOCGRS485)
 	struct serial_rs485 rs485;
 	unsigned int val;
 
@@ -903,7 +904,7 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
 			max310x_port_update(port, MAX310X_MODE2_REG,
 					    MAX310X_MODE2_ECHOSUPR_BIT, 0);
 		}
-		break;
+		return 0;
 	case TIOCGRS485:
 		memset(&rs485, 0, sizeof(rs485));
 		val = max310x_port_read(port, MAX310X_MODE1_REG);
@@ -916,12 +917,13 @@ static int max310x_ioctl(struct uart_port *port, unsigned int cmd,
 		if (copy_to_user((struct serial_rs485 *)arg, &rs485,
 				 sizeof(rs485)))
 			return -EFAULT;
-		break;
+		return 0;
 	default:
-		return -ENOIOCTLCMD;
+		break;
 	}
+#endif
 
-	return 0;
+	return -ENOIOCTLCMD;
 }
 
 static int max310x_startup(struct uart_port *port)
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-13 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 19:12 [PATCH v2] serial: max310x: Fix build error Alexander Shiyan

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).