From: Tobias Klauser <tklauser@distanz.ch>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] pty: define and set show_fdinfo only if procfs is enabled
Date: Mon, 2 Mar 2020 11:49:53 +0100 [thread overview]
Message-ID: <20200302104954.2812-1-tklauser@distanz.ch> (raw)
Follow the pattern used with other *_show_fdinfo functions and only
define and use pty_show_fdinfo if CONFIG_PROC_FS is set.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/tty/pty.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 00099a8439d2..dceaff332ca5 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -756,10 +756,12 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
}
}
+#ifdef CONFIG_PROC_FS
static void pty_show_fdinfo(struct tty_struct *tty, struct seq_file *m)
{
seq_printf(m, "tty-index:\t%d\n", tty->index);
}
+#endif
static const struct tty_operations ptm_unix98_ops = {
.lookup = ptm_unix98_lookup,
@@ -776,7 +778,9 @@ static const struct tty_operations ptm_unix98_ops = {
.compat_ioctl = pty_unix98_compat_ioctl,
.resize = pty_resize,
.cleanup = pty_cleanup,
+#ifdef CONFIG_PROC_FS
.show_fdinfo = pty_show_fdinfo,
+#endif
};
static const struct tty_operations pty_unix98_ops = {
--
2.25.0
next reply other threads:[~2020-03-02 10:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 10:49 Tobias Klauser [this message]
2020-03-02 10:49 ` [PATCH 2/2] tty: define and set show_fdinfo only if procfs is enabled Tobias Klauser
2020-03-02 10:52 ` Greg Kroah-Hartman
2020-03-02 10:51 ` [PATCH 1/2] pty: " Greg Kroah-Hartman
2020-03-02 13:37 ` Tobias Klauser
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=20200302104954.2812-1-tklauser@distanz.ch \
--to=tklauser@distanz.ch \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
/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).