From 8f5d9f2ce3020be1a7924b4cc4a1f51164f2c0b7 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 26 Jul 2019 15:21:39 +0200 Subject: compat_ioctl: ppp: move simple commands into ppp_generic.c All ppp commands that are not already handled in ppp_compat_ioctl() are compatible, so they can now handled by calling the native ppp_ioctl() directly. Without CONFIG_BLOCK, the generic compat_ioctl table is now empty, so add a check to avoid a build failure in the looking function for that configuration. Cc: netdev@vger.kernel.org Cc: linux-ppp@vger.kernel.org Cc: Paul Mackerras Cc: "David S. Miller" Signed-off-by: Arnd Bergmann --- drivers/net/ppp/ppp_generic.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/ppp/ppp_generic.c') diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index ce4dd45c541d..267fe2c58087 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -903,6 +903,10 @@ static long ppp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long } mutex_unlock(&ppp_mutex); + /* all other commands have compatible arguments */ + if (err == -ENOIOCTLCMD) + err = ppp_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); + return err; } #endif -- cgit v1.2.3-59-g8ed1b