Skip to contentSkip to conversation

vfio: mdev: make a couple of functions and structure vfio_mdev_driver static

PATCH Applied Xiongwei Song 5 participants 5 messages Dec 21, 2017 – Jan 16, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio: mdev: make a couple of functions and structure vfio_mdev_driver static

The functions vfio_mdev_probe, vfio_mdev_remove and the structure vfio_mdev_driver are only used in this file, so make them static.

Clean up sparse warnings:
drivers/vfio/mdev/vfio_mdev.c:114:5: warning: no previous prototype for 'vfio_mdev_probe' [-Wmissing-prototypes] drivers/vfio/mdev/vfio_mdev.c:121:6: warning: no previous prototype for 'vfio_mdev_remove' [-Wmissing-prototypes]

---
 drivers/vfio/mdev/vfio_mdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/vfio/mdev/vfio_mdev.c +3 -3
index fa848a701b8b..d230620fe02d 100644
@@ -111,19 +111,19 @@ static const struct vfio_device_ops vfio_mdev_dev_ops = {
 	.mmap		= vfio_mdev_mmap,
 };
 
-int vfio_mdev_probe(struct device *dev)
+static int vfio_mdev_probe(struct device *dev)
 {
 	struct mdev_device *mdev = to_mdev_device(dev);
 
 	return vfio_add_group_dev(dev, &vfio_mdev_dev_ops, mdev);
 }
 
-void vfio_mdev_remove(struct device *dev)
+static void vfio_mdev_remove(struct device *dev)
 {
 	vfio_del_group_dev(dev);
 }
 
-struct mdev_driver vfio_mdev_driver = {
+static struct mdev_driver vfio_mdev_driver = {
 	.name	= "vfio_mdev",
 	.probe	= vfio_mdev_probe,
 	.remove	= vfio_mdev_remove,
Signature · 1 line
2.15.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Xiongwei Song

The functions vfio_mdev_probe, vfio_mdev_remove and the structure vfio_mdev_driver are only used in this file, so make them static.

Clean up sparse warnings:
drivers/vfio/mdev/vfio_mdev.c:114:5: warning: no previous prototype for 'vfio_mdev_probe' [-Wmissing-prototypes] drivers/vfio/mdev/vfio_mdev.c:121:6: warning: no previous prototype for 'vfio_mdev_remove' [-Wmissing-prototypes]

---
  drivers/vfio/mdev/vfio_mdev.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/vfio/mdev/vfio_mdev.c +1 -2
index fa848a701b8b..d230620fe02d 100644
@@ -111,19 +111,19 @@ static const struct vfio_device_ops vfio_mdev_dev_ops = {
  	.mmap		= vfio_mdev_mmap,
  };
 
-int vfio_mdev_probe(struct device *dev)
+static int vfio_mdev_probe(struct device *dev)
  {
  	struct mdev_device *mdev = to_mdev_device(dev);
 
  	return vfio_add_group_dev(dev, &vfio_mdev_dev_ops, mdev);
  }
 
-void vfio_mdev_remove(struct device *dev)

drivers/vfio/mdev/vfio_mdev.c static const struct vfio_device_ops vfio_mdev_dev_ops = { · line 129

Quoted 10 lines
drivers/vfio/mdev/vfio_mdev.c +2 -1
+static void vfio_mdev_remove(struct device *dev)
  {
  	vfio_del_group_dev(dev);
  }
 
-struct mdev_driver vfio_mdev_driver = {
+static struct mdev_driver vfio_mdev_driver = {
  	.name	= "vfio_mdev",
  	.probe	= vfio_mdev_probe,
  	.remove	= vfio_mdev_remove,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Xiongwei Song
Quoted 48 lines

Sent: Friday, December 22, 2017 7:12 AM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH] vfio: mdev: make a couple of functions and structure vfio_mdev_driver static

The functions vfio_mdev_probe, vfio_mdev_remove and the structure vfio_mdev_driver are only used in this file, so make them static.

Clean up sparse warnings:
drivers/vfio/mdev/vfio_mdev.c:114:5: warning: no previous prototype for 'vfio_mdev_probe' [-Wmissing-prototypes] drivers/vfio/mdev/vfio_mdev.c:121:6: warning: no previous prototype for 'vfio_mdev_remove' [-Wmissing-prototypes]

---
 drivers/vfio/mdev/vfio_mdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/vfio/mdev/vfio_mdev.c index renamed from drivers/vfio/mdev/vfio_mdev.c +0 -0

fa848a701b8b..d230620fe02d 100644

drivers/vfio/mdev/vfio_mdev.c +3 -4
@@ -111,19 +111,19 @@ static const struct vfio_device_ops vfio_mdev_dev_ops =
 {
 	.mmap		= vfio_mdev_mmap,
 };
 
-int vfio_mdev_probe(struct device *dev)
+static int vfio_mdev_probe(struct device *dev)
 {
 	struct mdev_device *mdev = to_mdev_device(dev);
 
 	return vfio_add_group_dev(dev, &vfio_mdev_dev_ops, mdev);  }
 
-void vfio_mdev_remove(struct device *dev)
+static void vfio_mdev_remove(struct device *dev)
 {
 	vfio_del_group_dev(dev);
 }
 
-struct mdev_driver vfio_mdev_driver = {
+static struct mdev_driver vfio_mdev_driver = {
 	.name	= "vfio_mdev",
 	.probe	= vfio_mdev_probe,
 	.remove	= vfio_mdev_remove,
--
Quoted 1 line

2.15.1

maintainer
#3 lore raw
In reply to Xiongwei Song
Quoted 32 lines · Xiongwei Song

The functions vfio_mdev_probe, vfio_mdev_remove and the structure vfio_mdev_driver are only used in this file, so make them static.

Clean up sparse warnings:
drivers/vfio/mdev/vfio_mdev.c:114:5: warning: no previous prototype for 'vfio_mdev_probe' [-Wmissing-prototypes] drivers/vfio/mdev/vfio_mdev.c:121:6: warning: no previous prototype for 'vfio_mdev_remove' [-Wmissing-prototypes]

---
 drivers/vfio/mdev/vfio_mdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/vfio/mdev/vfio_mdev.c +1 -2
index fa848a701b8b..d230620fe02d 100644
@@ -111,19 +111,19 @@ static const struct vfio_device_ops vfio_mdev_dev_ops = {
 	.mmap		= vfio_mdev_mmap,
 };
 
-int vfio_mdev_probe(struct device *dev)
+static int vfio_mdev_probe(struct device *dev)
 {
 	struct mdev_device *mdev = to_mdev_device(dev);
 
 	return vfio_add_group_dev(dev, &vfio_mdev_dev_ops, mdev);
 }
 
-void vfio_mdev_remove(struct device *dev)

drivers/vfio/mdev/vfio_mdev.c static const struct vfio_device_ops vfio_mdev_dev_ops = { · line 129

Quoted 10 lines
drivers/vfio/mdev/vfio_mdev.c +2 -1
+static void vfio_mdev_remove(struct device *dev)
 {
 	vfio_del_group_dev(dev);
 }
 
-struct mdev_driver vfio_mdev_driver = {
+static struct mdev_driver vfio_mdev_driver = {
 	.name	= "vfio_mdev",
 	.probe	= vfio_mdev_probe,
 	.remove	= vfio_mdev_remove,

Reviewed by: Kirti Wankhede <[email protected]>

#4 lore raw
In reply to Xiongwei Song
Quoted 9 lines · On Fri, 22 Dec 2017 07:12:26 +0800 Xiongwei Song <[email protected]> wrote:

The functions vfio_mdev_probe, vfio_mdev_remove and the structure vfio_mdev_driver are only used in this file, so make them static.

Clean up sparse warnings:
drivers/vfio/mdev/vfio_mdev.c:114:5: warning: no previous prototype for 'vfio_mdev_probe' [-Wmissing-prototypes] drivers/vfio/mdev/vfio_mdev.c:121:6: warning: no previous prototype for 'vfio_mdev_remove' [-Wmissing-prototypes]

Quoted 4 lines
---
 drivers/vfio/mdev/vfio_mdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to next branch with reviewed-bys for v4.16. Thanks,

Alex