Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vfio: platform: mark symbols static where possible

We get a few warnings when building kernel with W=1:
drivers/vfio/platform/vfio_platform_common.c:76:5: warning: no previous prototype for 'vfio_platform_acpi_call_reset' [-Wmissing-prototypes]
drivers/vfio/platform/vfio_platform_common.c:98:6: warning: no previous prototype for 'vfio_platform_acpi_has_reset' [-Wmissing-prototypes]
drivers/vfio/platform/vfio_platform_common.c:640:5: warning: no previous prototype for 'vfio_platform_of_probe' [-Wmissing-prototypes]
drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:59:5: warning: no previous prototype for 'vfio_platform_amdxgbe_reset' [-Wmissing-prototypes]
drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c:60:5: warning: no previous prototype for 'vfio_platform_calxedaxgmac_reset' [-Wmissing-prototypes]
....

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Baptiste Reynal <b.reynal@virtualopensystems.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Baoyou Xie and committed by
Alex Williamson
2e062856 8138dabb

+5 -5
+1 -1
drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
··· 56 56 iowrite32(value, ioaddr + ((mmd_address & 0xff) << 2)); 57 57 } 58 58 59 - int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev) 59 + static int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev) 60 60 { 61 61 struct vfio_platform_region *xgmac_regs = &vdev->regions[0]; 62 62 struct vfio_platform_region *xpcs_regs = &vdev->regions[1];
+1 -1
drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c
··· 57 57 writel(value, ioaddr + XGMAC_CONTROL); 58 58 } 59 59 60 - int vfio_platform_calxedaxgmac_reset(struct vfio_platform_device *vdev) 60 + static int vfio_platform_calxedaxgmac_reset(struct vfio_platform_device *vdev) 61 61 { 62 62 struct vfio_platform_region *reg = &vdev->regions[0]; 63 63
+3 -3
drivers/vfio/platform/vfio_platform_common.c
··· 73 73 return WARN_ON(!vdev->acpihid) ? -EINVAL : 0; 74 74 } 75 75 76 - int vfio_platform_acpi_call_reset(struct vfio_platform_device *vdev, 76 + static int vfio_platform_acpi_call_reset(struct vfio_platform_device *vdev, 77 77 const char **extra_dbg) 78 78 { 79 79 #ifdef CONFIG_ACPI ··· 95 95 #endif 96 96 } 97 97 98 - bool vfio_platform_acpi_has_reset(struct vfio_platform_device *vdev) 98 + static bool vfio_platform_acpi_has_reset(struct vfio_platform_device *vdev) 99 99 { 100 100 #ifdef CONFIG_ACPI 101 101 struct device *dev = vdev->device; ··· 637 637 .mmap = vfio_platform_mmap, 638 638 }; 639 639 640 - int vfio_platform_of_probe(struct vfio_platform_device *vdev, 640 + static int vfio_platform_of_probe(struct vfio_platform_device *vdev, 641 641 struct device *dev) 642 642 { 643 643 int ret;