Skip to contentSkip to conversation

nvme: simplify compat_ioctl handling

PATCH New Christoph Hellwig 4 participants 4 messages Oct 5, 2017 – Oct 11, 2017 NVMe

lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme: simplify compat_ioctl handling

We can just use our normal ioctl handler for the compat case and remove the boilerplate code for it.

Signed-off-by Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/core.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/nvme/host/core.c +1 -11
index 26c8913435b2..573cc3b59bfa 100644
@@ -1052,16 +1052,6 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,
 	}
 }
 
-#ifdef CONFIG_COMPAT
-static int nvme_compat_ioctl(struct block_device *bdev, fmode_t mode,
-			unsigned int cmd, unsigned long arg)
-{
-	return nvme_ioctl(bdev, mode, cmd, arg);
-}
-#else
-#define nvme_compat_ioctl	NULL
-#endif
-
 static int nvme_open(struct block_device *bdev, fmode_t mode)
 {
 	return nvme_get_ns_from_disk(bdev->bd_disk) ? 0 : -ENXIO;
@@ -1380,7 +1370,7 @@ EXPORT_SYMBOL_GPL(nvme_sec_submit);
 static const struct block_device_operations nvme_fops = {
 	.owner		= THIS_MODULE,
 	.ioctl		= nvme_ioctl,
-	.compat_ioctl	= nvme_compat_ioctl,
+	.compat_ioctl	= nvme_ioctl,
 	.open		= nvme_open,
 	.release	= nvme_release,
 	.getgeo		= nvme_getgeo,
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 nvme: simplify compat_ioctl handling

drivers/nvme/host/core.c

Quoted 12 lines · Christoph Hellwig

We can just use our normal ioctl handler for the compat case and remove the boilerplate code for it.

Signed-off-by Christoph Hellwig <hch at lst.de>
---
  drivers/nvme/host/core.c | 12 +-----------
  1 file changed, 1 insertion(+), 11 deletions(-)
drivers/nvme/host/core.c +0 -0
index 26c8913435b2..573cc3b59bfa 100644

Looks good,
Reviewed-by: Max Gurtovoy <maxg at mellanox.com>

#2 lore raw

PATCH 1/1 nvme: simplify compat_ioctl handling

In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

We can just use our normal ioctl handler for the compat case and remove the boilerplate code for it.

Signed-off-by Christoph Hellwig <hch at lst.de>

Looks good. The compact ioctl was left-over from SG_IO handling.

Reviewed-by Keith Busch <keith.busch at intel.com>