Skip to contentSkip to conversation

vfio/mdev: add static modifier to add_mdev_supported_type

PATCH Applied Paolo Cretaro 3 participants 3 messages Nov 13, 2018 – Dec 12, 2018

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

PATCH 1/1 vfio/mdev: add static modifier to add_mdev_supported_type

Set add_mdev_supported_type as static since it is only used within mdev_sysfs.c.
This fixes -Wmissing-prototypes gcc warning.

---
 drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vfio/mdev/mdev_sysfs.c +2 -2
index 249472f05509..ce5dd219f2c8 100644
@@ -92,8 +92,8 @@ static struct kobj_type mdev_type_ktype = {
 	.release = mdev_type_release,
 };
 
-struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
-					  struct attribute_group *group)
+static struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
+						 struct attribute_group *group)
 {
 	struct mdev_type *type;
 	int ret;
Signature · 1 line
2.19.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · On Tue, 13 Nov 2018 09:45:43 +0100 Paolo Cretaro <[email protected]> wrote:

Set add_mdev_supported_type as static since it is only used within mdev_sysfs.c.
This fixes -Wmissing-prototypes gcc warning.

---
 drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vfio/mdev/mdev_sysfs.c +0 -0
index 249472f05509..ce5dd219f2c8 100644

drivers/vfio/mdev/mdev_sysfs.c static struct kobj_type mdev_type_ktype = { · line 99

Quoted 10 lines
drivers/vfio/mdev/mdev_sysfs.c +2 -2
@@ -92,8 +92,8 @@ static struct kobj_type mdev_type_ktype = {
 	.release = mdev_type_release,
 };
 
-struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
-					  struct attribute_group *group)
+static struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
+						 struct attribute_group *group)
 {
 	struct mdev_type *type;
 	int ret;
#2 lore raw
In reply to Paolo Cretaro
Quoted 14 lines · On Tue, 13 Nov 2018 09:45:43 +0100 Paolo Cretaro <[email protected]> wrote:

Set add_mdev_supported_type as static since it is only used within mdev_sysfs.c.
This fixes -Wmissing-prototypes gcc warning.

---
 drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vfio/mdev/mdev_sysfs.c +0 -0
index 249472f05509..ce5dd219f2c8 100644

drivers/vfio/mdev/mdev_sysfs.c static struct kobj_type mdev_type_ktype = { · line 99

Quoted 10 lines
drivers/vfio/mdev/mdev_sysfs.c +2 -2
@@ -92,8 +92,8 @@ static struct kobj_type mdev_type_ktype = {
 	.release = mdev_type_release,
 };
 
-struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
-					  struct attribute_group *group)
+static struct mdev_type *add_mdev_supported_type(struct mdev_parent *parent,
+						 struct attribute_group *group)
 {
 	struct mdev_type *type;
 	int ret;

Applied to vfio next branch with Cornlia's review. Thanks,

Alex