mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Scott Branden <scott.branden@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	Olof Johansson <olof@lixom.net>,
	Desmond Yan <desmond.yan@broadcom.com>
Subject: Re: [PATCH v2] misc: bcm-vk: only support ttyVK if CONFIG_TTY is set
Date: Sat, 30 Jan 2021 09:55:03 +0100	[thread overview]
Message-ID: <YBUe58hiyI81oUOp@kroah.com> (raw)
In-Reply-To: <20210129220627.22641-1-scott.branden@broadcom.com>

On Fri, Jan 29, 2021 at 02:06:27PM -0800, Scott Branden wrote:
> Correct compile issue if CONFIG_TTY is not set by
> only adding ttyVK devices if CONFIG_TTY is set.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
> 
> ---
> Changes since v1:
> Add function stubs rather than compiling out code
> ---
>  drivers/misc/bcm-vk/Makefile     |  4 ++--
>  drivers/misc/bcm-vk/bcm_vk.h     | 35 +++++++++++++++++++++++++++++---
>  drivers/misc/bcm-vk/bcm_vk_dev.c |  3 +--
>  drivers/misc/bcm-vk/bcm_vk_tty.c |  6 ++++++
>  4 files changed, 41 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/misc/bcm-vk/Makefile b/drivers/misc/bcm-vk/Makefile
> index e4a1486f7209..8d81a734fcad 100644
> --- a/drivers/misc/bcm-vk/Makefile
> +++ b/drivers/misc/bcm-vk/Makefile
> @@ -7,6 +7,6 @@ obj-$(CONFIG_BCM_VK) += bcm_vk.o
>  bcm_vk-objs := \
>  	bcm_vk_dev.o \
>  	bcm_vk_msg.o \
> -	bcm_vk_sg.o \
> -	bcm_vk_tty.o
> +	bcm_vk_sg.o
>  
> +bcm_vk-$(CONFIG_TTY) += bcm_vk_tty.o
> diff --git a/drivers/misc/bcm-vk/bcm_vk.h b/drivers/misc/bcm-vk/bcm_vk.h
> index 3f37c640a814..4a1d515374c7 100644
> --- a/drivers/misc/bcm-vk/bcm_vk.h
> +++ b/drivers/misc/bcm-vk/bcm_vk.h
> @@ -258,7 +258,11 @@ enum pci_barno {
>  	BAR_2
>  };
>  
> +#ifdef CONFIG_TTY
>  #define BCM_VK_NUM_TTY 2
> +#else
> +#define BCM_VK_NUM_TTY 0
> +#endif
>  
>  struct bcm_vk_tty {
>  	struct tty_port port;
> @@ -366,11 +370,15 @@ struct bcm_vk {
>  	struct miscdevice miscdev;
>  	int devid; /* dev id allocated */
>  
> +#ifdef CONFIG_TTY
>  	struct tty_driver *tty_drv;
>  	struct timer_list serial_timer;
>  	struct bcm_vk_tty tty[BCM_VK_NUM_TTY];
>  	struct workqueue_struct *tty_wq_thread;
>  	struct work_struct tty_wq_work;
> +#else
> +	struct bcm_vk_tty *tty;

Why do you still need this pointer?

And should you just have a separate config option for your tty driver
instead that depends on CONFIG_TTY?  Would you ever want to run this
driver without the tty portion?

Oh, and much better than the previous version, thanks for cleaning it
up.

thanks,

greg k-h

  parent reply	other threads:[~2021-01-30  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 22:06 Scott Branden
2021-01-29 22:41 ` Randy Dunlap
2021-01-30  8:55 ` Greg Kroah-Hartman [this message]
2021-01-30 23:26   ` Scott Branden

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=YBUe58hiyI81oUOp@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=desmond.yan@broadcom.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=scott.branden@broadcom.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

all inboxes | Powered by JetHome®