From 07a4559495d2d2690b0210abfba615c2914a2d9a Mon Sep 17 00:00:00 2001 From: Ravi Pokala Date: Wed, 15 Feb 2017 17:33:03 +0000 Subject: [PATCH] Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. Reviewed by: emaste --- sys/dev/vt/vt_buf.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c index 92da3d26330d..5a7bee55f256 100644 --- a/sys/dev/vt/vt_buf.c +++ b/sys/dev/vt/vt_buf.c @@ -55,10 +55,10 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "vt buffer"); } while (0) #ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); static int vtbuf_wth(const struct vt_buf *vb, int row); static int vtbuf_in_this_range(int begin, int test, int end, int sz); #endif -static int vtbuf_htw(const struct vt_buf *vb, int row); /* * line4 @@ -161,6 +161,21 @@ vthistory_getpos(const struct vt_buf *vb, unsigned int *offset) } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ +/* Translate history row to current view row number. */ +static int +vtbuf_htw(const struct vt_buf *vb, int row) +{ + + /* + * total 1000 rows. + * History offset roffset winrow + * 205 200 ((205 - 200 + 1000) % 1000) = 5 + * 90 990 ((90 - 990 + 1000) % 1000) = 100 + */ + return ((row - vb->vb_roffset + vb->vb_history_size) % + vb->vb_history_size); +} + /* Translate current view row number to history row. */ static int vtbuf_wth(const struct vt_buf *vb, int row) @@ -192,21 +207,6 @@ vtbuf_in_this_range(int begin, int test, int end, int sz) } #endif -/* Translate history row to current view row number. */ -static int -vtbuf_htw(const struct vt_buf *vb, int row) -{ - - /* - * total 1000 rows. - * History offset roffset winrow - * 205 200 ((205 - 200 + 1000) % 1000) = 5 - * 90 990 ((90 - 990 + 1000) % 1000) = 100 - */ - return ((row - vb->vb_roffset + vb->vb_history_size) % - vb->vb_history_size); -} - int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) {