2018-11-13 08:47:04

by Paolo Cretaro

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Paolo Cretaro <[email protected]>
---
drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
index 249472f05509..ce5dd219f2c8 100644
--- a/drivers/vfio/mdev/mdev_sysfs.c
+++ b/drivers/vfio/mdev/mdev_sysfs.c
@@ -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.19.1



2018-11-13 10:16:38

by Cornelia Huck

[permalink] [raw]
Subject: Re: [PATCH] vfio/mdev: add static modifier to add_mdev_supported_type

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.
>
> Signed-off-by: Paolo Cretaro <[email protected]>
> ---
> drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
> index 249472f05509..ce5dd219f2c8 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -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;

Reviewed-by: Cornelia Huck <[email protected]>

2018-12-12 22:46:44

by Alex Williamson

[permalink] [raw]
Subject: Re: [PATCH] vfio/mdev: add static modifier to add_mdev_supported_type

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.
>
> Signed-off-by: Paolo Cretaro <[email protected]>
> ---
> drivers/vfio/mdev/mdev_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
> index 249472f05509..ce5dd219f2c8 100644
> --- a/drivers/vfio/mdev/mdev_sysfs.c
> +++ b/drivers/vfio/mdev/mdev_sysfs.c
> @@ -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