From: Oleg Nesterov <oleg@redhat.com>
To: Pekka Enberg <penberg@kernel.org>,
Sasha Levin <sasha.levin@oracle.com>,
Will Deacon <will.deacon@arm.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH] kvmtool/term: unexport term_set_tty, term_init, term_exit
Date: Mon, 19 Oct 2015 16:28:53 +0200 [thread overview]
Message-ID: <20151019142853.GA21583@redhat.com> (raw)
According to git grep they can be static.
term_got_escape can be static too, and we can even move it into
term_getc().
"int term_escape_char" doesn't make sense at least until we allow
to redefine it, turn it into preprocessor constant.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
include/kvm/term.h | 3 ---
term.c | 15 ++++++++-------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/include/kvm/term.h b/include/kvm/term.h
index dc9882e..b9793f0 100644
--- a/include/kvm/term.h
+++ b/include/kvm/term.h
@@ -18,9 +18,6 @@ int term_putc(char *addr, int cnt, int term);
int term_getc(struct kvm *kvm, int term);
bool term_readable(int term);
-void term_set_tty(int term);
-int term_init(struct kvm *kvm);
-int term_exit(struct kvm *kvm);
int tty_parser(const struct option *opt, const char *arg, int unset);
#endif /* KVM__TERM_H */
diff --git a/term.c b/term.c
index 9763211..aebd174 100644
--- a/term.c
+++ b/term.c
@@ -19,15 +19,16 @@
static struct termios orig_term;
-int term_escape_char = 0x01; /* ctrl-a is used for escape */
-bool term_got_escape = false;
-
-int term_fds[TERM_MAX_DEVS][2];
+static int term_fds[TERM_MAX_DEVS][2];
static pthread_t term_poll_thread;
+/* ctrl-a is used for escape */
+#define term_escape_char 0x01
+
int term_getc(struct kvm *kvm, int term)
{
+ static bool term_got_escape = false;
unsigned char c;
if (read_in_full(term_fds[term][TERM_FD_IN], &c, 1) < 0)
@@ -137,7 +138,7 @@ static void term_sig_cleanup(int sig)
raise(sig);
}
-void term_set_tty(int term)
+static void term_set_tty(int term)
{
struct termios orig_term;
int master, slave;
@@ -167,7 +168,7 @@ int tty_parser(const struct option *opt, const char *arg, int unset)
return 0;
}
-int term_init(struct kvm *kvm)
+static int term_init(struct kvm *kvm)
{
struct termios term;
int i, r;
@@ -204,7 +205,7 @@ int term_init(struct kvm *kvm)
}
dev_init(term_init);
-int term_exit(struct kvm *kvm)
+static int term_exit(struct kvm *kvm)
{
return 0;
}
--
2.4.3
reply other threads:[~2015-10-19 14:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151019142853.GA21583@redhat.com \
--to=oleg@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=penberg@kernel.org \
--cc=sasha.levin@oracle.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).