Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: cpwd: fix build regression
Date: Tue, 8 Oct 2019 08:14:20 -0700
Message-ID: <20191008151420.GA15540@roeck-us.net> (raw)
In-Reply-To: <20191008073634.290255-1-arnd@arndb.de>

On Tue, Oct 08, 2019 at 09:36:16AM +0200, Arnd Bergmann wrote:
> The compat_ptr_ioctl() infrastructure did not make it into
> linux-5.4, so cpwd now fails to build.
> 
> Fix it by using an open-coded version.
> 
> Fixes: 68f28b01fb9e ("watchdog: cpwd: use generic compat_ptr_ioctl")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> ---
>  drivers/watchdog/cpwd.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
> index 9393be584e72..808eeb4779e4 100644
> --- a/drivers/watchdog/cpwd.c
> +++ b/drivers/watchdog/cpwd.c
> @@ -26,6 +26,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/ioport.h>
>  #include <linux/timer.h>
> +#include <linux/compat.h>
>  #include <linux/slab.h>
>  #include <linux/mutex.h>
>  #include <linux/io.h>
> @@ -473,6 +474,11 @@ static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  	return 0;
>  }
>  
> +static long cpwd_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> +{
> +	return cpwd_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
> +}
> +
>  static ssize_t cpwd_write(struct file *file, const char __user *buf,
>  			  size_t count, loff_t *ppos)
>  {
> @@ -497,7 +503,7 @@ static ssize_t cpwd_read(struct file *file, char __user *buffer,
>  static const struct file_operations cpwd_fops = {
>  	.owner =		THIS_MODULE,
>  	.unlocked_ioctl =	cpwd_ioctl,
> -	.compat_ioctl =		compat_ptr_ioctl,
> +	.compat_ioctl =		cpwd_compat_ioctl,
>  	.open =			cpwd_open,
>  	.write =		cpwd_write,
>  	.read =			cpwd_read,
> -- 
> 2.20.0
> 

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  7:36 Arnd Bergmann
2019-10-08 15:14 ` Guenter Roeck [this message]

Reply instructions:

You may reply publically 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=20191008151420.GA15540@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@linux-watchdog.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

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git