Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5616738imm; Wed, 12 Sep 2018 08:33:53 -0700 (PDT) X-Google-Smtp-Source: ANB0VdatKUWb9CdVcrdjINu1t+rY+uimWwqONgtgGxZ5+C6mBDQ2Nwv+/1oYtxYyFr6R5ml3ES/M X-Received: by 2002:a62:9683:: with SMTP id s3-v6mr3002367pfk.191.1536766433390; Wed, 12 Sep 2018 08:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536766433; cv=none; d=google.com; s=arc-20160816; b=QSBViOcni6tlLBF81owBdCr/z0zBf3XqRWpC/0qUHoPCJYKNEI9tqZaNn+7ImweXPo jm8Nna7GYl3LiXQbctYaF/rusTdkz3IMjaKQv0l8sX3az7pu/434TSJtx0jfvhHx86aL FKWjZfMLwJxml7SQFB56a6HLUpxYYnhsaB7bLKmyVDTbTuWQNZTTAq3svawSmCkeUkKU jQs7gwxQe/GgMDWE1OPzkdso1G7ppZzs9LbOfz0RKGQ4nzJ6Ifd6ripvfcPEvVJQ8dbh wLiT8SsbGz0gSCDVLykxCh5VUw8sfvQ9mRI1zRB5NFo1pjTSNcMLlhSlwPZedvHbBdhX eYiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Erh9Dg+RiMAiy9HjZnazEgbEJ8PMdQAqsBJo9ckm8uw=; b=VMM4B482jj0Rt4nBTWb2z2wmDPVQFO9HYbi7VTWXOuZJLXp1yBJFDWnQGBzozACoRT ytC9djiZieCOT3wn9UmPJtpW3ME4kzQqIafMm1lDB8GdMLS7MbZLK3TR0FmfyIeofnGG NHLG1A0Vee3m85hk1bN4RxMq39nlst7IIpkLKzhXSkyLHPP92mfhD5wZ6olnMRJRoW8c Q0ma0T8cxH5Z2dVBaRc6nTJCNssHaXHihe6dFpZ96PGKu54JCpooMgCfe09K8nqDfned XUyFg58/4yUQKl4b+tdXh5jg8eOIQ+8VOCdfcyUXIyWLI2uRAiajtIfRfx0KG9ytWVQK 2itQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dWCfnec8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23-v6si1443353pgm.170.2018.09.12.08.33.31; Wed, 12 Sep 2018 08:33:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dWCfnec8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbeILUiF (ORCPT + 99 others); Wed, 12 Sep 2018 16:38:05 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46294 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbeILUiF (ORCPT ); Wed, 12 Sep 2018 16:38:05 -0400 Received: by mail-pf1-f194.google.com with SMTP id u24-v6so1179245pfn.13 for ; Wed, 12 Sep 2018 08:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Erh9Dg+RiMAiy9HjZnazEgbEJ8PMdQAqsBJo9ckm8uw=; b=dWCfnec8vRFWp7+dIbMTxp8GtdT2tpvy0TfDui//rm1C/yGGBFnkttVGyM189c9Qaf stXcaGCNwjfwwUAathMSVitQbkv4aou0Sqtw6BGOwqF1/J3ovlF8j+/PpQRaWzSgANTc vLL5xZ1Z+K537alUlB4m0NMI/BoCaDWC//g2zWWH9VPFYnB1KSZZWveZ29zb/PZE192p n7CRJuIUTOP9U6tLAhoQzmcvKpeIu0Iv9oUAwKXSzfyJFe393Zi0RHpSm+cvSg8pgnjd GBYoxGhCXAiX9njfBNHrbCUFpFSMgvwVoR5xG33eofVOVJmi2QxiNxNVJ/6GE/jhAx0U 5s2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Erh9Dg+RiMAiy9HjZnazEgbEJ8PMdQAqsBJo9ckm8uw=; b=jpUvySIuKTEygSRtd5ve9MvEtdW0GhjpSF02Wd/P5j9S4YmpEb+ZMEfziTG3luBk8+ qMbZEl4sib6RezX9iL9+IBMZJyL5HCvjFIZb3IFtDAcux3ef8cUTtnvra2in2d9xMTBY 9CvwB2rv3JOclQI53M/6vdFnuQ5GgflEUv/HxMlVRog8/sLgymPX/ivjsGCgDkXxPX5y pzfSrKhvx051aaEw5nUkDt4Gi+R2WWsRhE3becfyvtw655eS1Yq2K5S3WRjSTichqsdi Gk2ueWUYzZCD4I/MFxV8SZ4tV9jKWeyHan637wpOIuP50j9rMOXNYermLCE5gbf3eF0c ycZg== X-Gm-Message-State: APzg51AK1FSUStUosTFeQOjwT78EJjUoWwMlaYJI4IGtaZr4A1YqWUqU zDnswwBbStG9F3uWd1V8zqLkvQ== X-Received: by 2002:a65:50c9:: with SMTP id s9-v6mr2962510pgp.417.1536766382561; Wed, 12 Sep 2018 08:33:02 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id z11-v6sm2133238pff.162.2018.09.12.08.33.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 08:33:01 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1g078W-00072D-GD; Wed, 12 Sep 2018 09:33:00 -0600 Date: Wed, 12 Sep 2018 09:33:00 -0600 From: Jason Gunthorpe To: Arnd Bergmann Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Sudip Mukherjee , Greg Kroah-Hartman , Peter Huewe , Jarkko Sakkinen , Stefan Richter , Jiri Kosina , Benjamin Tissoires , Alexander Shishkin , Tomas Winkler , Artem Bityutskiy , Marek Vasut , "David S. Miller" , Alex Williamson , OGAWA Hirofumi , linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org, devel@driverdev.osuosl.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v2 02/17] compat_ioctl: move drivers to generic_compat_ioctl_ptrarg Message-ID: <20180912153300.GE5633@ziepe.ca> References: <20180912150142.157913-1-arnd@arndb.de> <20180912150142.157913-2-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180912150142.157913-2-arnd@arndb.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 05:01:03PM +0200, Arnd Bergmann wrote: > Each of these drivers has a copy of the same trivial helper function to > convert the pointer argument and then call the native ioctl handler. > > We now have a generic implementation of that, so use it. > > Signed-off-by: Arnd Bergmann > drivers/char/ppdev.c | 12 +--------- > drivers/char/tpm/tpm_vtpm_proxy.c | 12 +--------- > drivers/firewire/core-cdev.c | 12 +--------- > drivers/hid/usbhid/hiddev.c | 11 +-------- > drivers/hwtracing/stm/core.c | 12 +--------- > drivers/misc/mei/main.c | 22 +---------------- > drivers/mtd/ubi/cdev.c | 36 +++------------------------- > drivers/net/tap.c | 12 +--------- > drivers/staging/pi433/pi433_if.c | 12 +--------- > drivers/usb/core/devio.c | 16 +------------ > drivers/vfio/vfio.c | 39 +++---------------------------- > drivers/vhost/net.c | 12 +--------- > drivers/vhost/scsi.c | 12 +--------- > drivers/vhost/test.c | 12 +--------- > drivers/vhost/vsock.c | 12 +--------- > fs/fat/file.c | 13 +---------- > 16 files changed, 20 insertions(+), 237 deletions(-) > > diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c > index 87a0ce47f201..a170f5ca7416 100644 > +++ b/drivers/char/tpm/tpm_vtpm_proxy.c > @@ -678,20 +678,10 @@ static long vtpmx_fops_ioctl(struct file *f, unsigned int ioctl, > } > } > > -#ifdef CONFIG_COMPAT > -static long vtpmx_fops_compat_ioctl(struct file *f, unsigned int ioctl, > - unsigned long arg) > -{ > - return vtpmx_fops_ioctl(f, ioctl, (unsigned long)compat_ptr(arg)); > -} > -#endif > - > static const struct file_operations vtpmx_fops = { > .owner = THIS_MODULE, > .unlocked_ioctl = vtpmx_fops_ioctl, > -#ifdef CONFIG_COMPAT > - .compat_ioctl = vtpmx_fops_compat_ioctl, > -#endif > + .compat_ioctl = generic_compat_ioctl_ptrarg, > .llseek = noop_llseek, > }; For vtpm: Reviewed-by: Jason Gunthorpe Arnd, would you consider including a patch as part of/after this series to make compat_ioctl in drivers/infiniband/core/uverbs_main.c use this as well? Looks like a bug too? Thanks, Jason