[v2] virtiofs: Use static const, not const static
diff mbox series

Message ID 1573474545-37037-1-git-send-email-zhengbin13@huawei.com
State New
Headers show
Series
  • [v2] virtiofs: Use static const, not const static
Related show

Commit Message

zhengbin (A) Nov. 11, 2019, 12:15 p.m. UTC
Move the static keyword to the front of declarations, which resolves
compiler warnings when building with "W=1":

fs/fuse/virtio_fs.c:687:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
 const static struct virtio_device_id id_table[] = {
 ^
fs/fuse/virtio_fs.c:692:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
 const static unsigned int feature_table[] = {};
 ^
fs/fuse/virtio_fs.c:1029:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
 const static struct fuse_iqueue_ops virtio_fs_fiq_ops = {

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
v1->v2: modify comment
 fs/fuse/virtio_fs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.7.4

Comments

Stefan Hajnoczi Nov. 12, 2019, 10:33 a.m. UTC | #1
On Mon, Nov 11, 2019 at 08:15:45PM +0800, zhengbin wrote:
> Move the static keyword to the front of declarations, which resolves
> compiler warnings when building with "W=1":
> 
> fs/fuse/virtio_fs.c:687:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct virtio_device_id id_table[] = {
>  ^
> fs/fuse/virtio_fs.c:692:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static unsigned int feature_table[] = {};
>  ^
> fs/fuse/virtio_fs.c:1029:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct fuse_iqueue_ops virtio_fs_fiq_ops = {
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
> v1->v2: modify comment
>  fs/fuse/virtio_fs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Vivek Goyal Nov. 12, 2019, 1:18 p.m. UTC | #2
On Mon, Nov 11, 2019 at 08:15:45PM +0800, zhengbin wrote:
> Move the static keyword to the front of declarations, which resolves
> compiler warnings when building with "W=1":
> 
> fs/fuse/virtio_fs.c:687:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct virtio_device_id id_table[] = {
>  ^
> fs/fuse/virtio_fs.c:692:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static unsigned int feature_table[] = {};
>  ^
> fs/fuse/virtio_fs.c:1029:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct fuse_iqueue_ops virtio_fs_fiq_ops = {
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek
> ---
> v1->v2: modify comment
>  fs/fuse/virtio_fs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index b77acea..2ac6818 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -684,12 +684,12 @@ static int virtio_fs_restore(struct virtio_device *vdev)
>  }
>  #endif /* CONFIG_PM_SLEEP */
> 
> -const static struct virtio_device_id id_table[] = {
> +static const struct virtio_device_id id_table[] = {
>  	{ VIRTIO_ID_FS, VIRTIO_DEV_ANY_ID },
>  	{},
>  };
> 
> -const static unsigned int feature_table[] = {};
> +static const unsigned int feature_table[] = {};
> 
>  static struct virtio_driver virtio_fs_driver = {
>  	.driver.name		= KBUILD_MODNAME,
> @@ -1026,7 +1026,7 @@ __releases(fiq->lock)
>  	}
>  }
> 
> -const static struct fuse_iqueue_ops virtio_fs_fiq_ops = {
> +static const struct fuse_iqueue_ops virtio_fs_fiq_ops = {
>  	.wake_forget_and_unlock		= virtio_fs_wake_forget_and_unlock,
>  	.wake_interrupt_and_unlock	= virtio_fs_wake_interrupt_and_unlock,
>  	.wake_pending_and_unlock	= virtio_fs_wake_pending_and_unlock,
> --
> 2.7.4
>

Patch
diff mbox series

diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index b77acea..2ac6818 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -684,12 +684,12 @@  static int virtio_fs_restore(struct virtio_device *vdev)
 }
 #endif /* CONFIG_PM_SLEEP */

-const static struct virtio_device_id id_table[] = {
+static const struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_FS, VIRTIO_DEV_ANY_ID },
 	{},
 };

-const static unsigned int feature_table[] = {};
+static const unsigned int feature_table[] = {};

 static struct virtio_driver virtio_fs_driver = {
 	.driver.name		= KBUILD_MODNAME,
@@ -1026,7 +1026,7 @@  __releases(fiq->lock)
 	}
 }

-const static struct fuse_iqueue_ops virtio_fs_fiq_ops = {
+static const struct fuse_iqueue_ops virtio_fs_fiq_ops = {
 	.wake_forget_and_unlock		= virtio_fs_wake_forget_and_unlock,
 	.wake_interrupt_and_unlock	= virtio_fs_wake_interrupt_and_unlock,
 	.wake_pending_and_unlock	= virtio_fs_wake_pending_and_unlock,