aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tty3270.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/tty3270.c')
-rw-r--r--drivers/s390/char/tty3270.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index bc33068b9ce2..70b1980a08b6 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -25,8 +25,8 @@
25#include <asm/ebcdic.h> 25#include <asm/ebcdic.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27 27
28
29#include "raw3270.h" 28#include "raw3270.h"
29#include "tty3270.h"
30#include "keyboard.h" 30#include "keyboard.h"
31 31
32#define TTY3270_CHAR_BUF_SIZE 256 32#define TTY3270_CHAR_BUF_SIZE 256
@@ -1338,8 +1338,11 @@ tty3270_getpar(struct tty3270 *tp, int ix)
1338static void 1338static void
1339tty3270_goto_xy(struct tty3270 *tp, int cx, int cy) 1339tty3270_goto_xy(struct tty3270 *tp, int cx, int cy)
1340{ 1340{
1341 tp->cx = min_t(int, tp->view.cols - 1, max_t(int, 0, cx)); 1341 int max_cx = max(0, cx);
1342 cy = min_t(int, tp->view.rows - 3, max_t(int, 0, cy)); 1342 int max_cy = max(0, cy);
1343
1344 tp->cx = min_t(int, tp->view.cols - 1, max_cx);
1345 cy = min_t(int, tp->view.rows - 3, max_cy);
1343 if (cy != tp->cy) { 1346 if (cy != tp->cy) {
1344 tty3270_convert_line(tp, tp->cy); 1347 tty3270_convert_line(tp, tp->cy);
1345 tp->cy = cy; 1348 tp->cy = cy;