linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Bamvor Zhang Jian <bamvor.zhangjian@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>
Subject: Re: [RFC PATCH v2 3/4] ppdev: add compat ioctl
Date: Wed, 8 Jul 2015 13:17:18 -0700	[thread overview]
Message-ID: <CALAqxLUSVEbGicEiAjO=bEcMw4L=djjGLQTfEni6S8skk+H=Og@mail.gmail.com> (raw)
In-Reply-To: <1435587807-10008-4-git-send-email-bamvor.zhangjian@linaro.org>

On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian
<bamvor.zhangjian@linaro.org> wrote:
> Add compat ioctl in ppdev in order to solve the y2038 issue in
> later patch.
> This patch simply add pp_do_ioctl to compat_ioctl, because I found
> that all the ioctl access the arg as a pointer.
>
> Signed-off-by: Bamvor Zhang Jian <bamvor.zhangjian@linaro.org>
> ---
>  drivers/char/ppdev.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
> index ae0b42b..9207658 100644
> --- a/drivers/char/ppdev.c
> +++ b/drivers/char/ppdev.c
> @@ -69,6 +69,7 @@
>  #include <linux/ppdev.h>
>  #include <linux/mutex.h>
>  #include <linux/uaccess.h>
> +#include <linux/compat.h>
>
>  #define PP_VERSION "ppdev: user-space parallel port driver"
>  #define CHRDEV "ppdev"
> @@ -635,6 +636,11 @@ static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>         return ret;
>  }
>
> +static long pp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> +{
> +       return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
> +}
> +
>  static int pp_open (struct inode * inode, struct file * file)
>  {
>         unsigned int minor = iminor(inode);
> @@ -744,6 +750,9 @@ static const struct file_operations pp_fops = {
>         .write          = pp_write,
>         .poll           = pp_poll,
>         .unlocked_ioctl = pp_ioctl,
> +#ifdef CONFIG_COMPAT
> +       .compat_ioctl   = pp_compat_ioctl,
> +#endif

Does adding this patch w/o the following patch break 32bit apps using
this on 64bit kernels?

thanks
-john

  reply	other threads:[~2015-07-08 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 14:23 [RFC PATCH v2 0/4] Convert ppdev to y2038 safe Bamvor Zhang Jian
2015-06-29 14:23 ` [RFC PATCH v2 1/4] y2038: add 64bit time_t support in timeval for 32bit architecture Bamvor Zhang Jian
2015-07-08 20:09   ` John Stultz
2015-07-09  9:02     ` Bamvor Zhang Jian
2015-07-09 10:26       ` Arnd Bergmann
2015-07-15  3:18         ` Bamvor Zhang Jian
2015-07-15  9:33           ` Arnd Bergmann
2015-06-29 14:23 ` [RFC PATCH v2 2/4] time64: add timeval64 helper for compat syscalls Bamvor Zhang Jian
2015-06-29 14:23 ` [RFC PATCH v2 3/4] ppdev: add compat ioctl Bamvor Zhang Jian
2015-07-08 20:17   ` John Stultz [this message]
2015-07-08 21:28     ` [Y2038] " Arnd Bergmann
2015-06-29 14:23 ` [RFC PATCH v2 4/4] y2038: convert ppdev to 2038 safe Bamvor Zhang Jian
2015-07-08 21:34   ` Arnd Bergmann
2015-07-08 21:36   ` Arnd Bergmann

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='CALAqxLUSVEbGicEiAjO=bEcMw4L=djjGLQTfEni6S8skk+H=Og@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bamvor.zhangjian@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=y2038@lists.linaro.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).