From: Ye Bin <yebin10@huawei.com> To: <yebin10@huawei.com> Cc: <dri-devel@lists.freedesktop.org>, <linux-fbdev@vger.kernel.org>, <kernel-janitors@vger.kernel.org>, Hulk Robot <hulkci@huawei.com> Subject: [PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head Date: Fri, 9 Apr 2021 17:51:43 +0800 [thread overview] Message-ID: <20210409095143.2294091-1-yebin10@huawei.com> (raw) mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). list head can be initialized automatically with LIST_HEAD() rather than explicitly calling INIT_LIST_HEAD(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> --- drivers/video/fbdev/vermilion/vermilion.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c index ff61605b8764..689170d25bc8 100644 --- a/drivers/video/fbdev/vermilion/vermilion.c +++ b/drivers/video/fbdev/vermilion/vermilion.c @@ -35,9 +35,9 @@ #define VML_TOHW(_val, _width) ((((_val) << (_width)) + 0x7FFF - (_val)) >> 16) -static struct mutex vml_mutex; -static struct list_head global_no_mode; -static struct list_head global_has_mode; +static DEFINE_MUTEX(vml_mutex); +static LIST_HEAD(global_no_mode); +static LIST_HEAD(global_has_mode); static struct fb_ops vmlfb_ops; static struct vml_sys *subsys = NULL; static char *vml_default_mode = "1024x768@60"; @@ -1058,9 +1058,6 @@ static int __init vmlfb_init(void) #endif printk(KERN_DEBUG MODULE_NAME ": initializing\n"); - mutex_init(&vml_mutex); - INIT_LIST_HEAD(&global_no_mode); - INIT_LIST_HEAD(&global_has_mode); return pci_register_driver(&vmlfb_pci_driver); }
WARNING: multiple messages have this Message-ID (diff)
From: Ye Bin <yebin10@huawei.com> To: <yebin10@huawei.com> Cc: Hulk Robot <hulkci@huawei.com>, linux-fbdev@vger.kernel.org, kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head Date: Fri, 9 Apr 2021 17:51:43 +0800 [thread overview] Message-ID: <20210409095143.2294091-1-yebin10@huawei.com> (raw) mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). list head can be initialized automatically with LIST_HEAD() rather than explicitly calling INIT_LIST_HEAD(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> --- drivers/video/fbdev/vermilion/vermilion.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c index ff61605b8764..689170d25bc8 100644 --- a/drivers/video/fbdev/vermilion/vermilion.c +++ b/drivers/video/fbdev/vermilion/vermilion.c @@ -35,9 +35,9 @@ #define VML_TOHW(_val, _width) ((((_val) << (_width)) + 0x7FFF - (_val)) >> 16) -static struct mutex vml_mutex; -static struct list_head global_no_mode; -static struct list_head global_has_mode; +static DEFINE_MUTEX(vml_mutex); +static LIST_HEAD(global_no_mode); +static LIST_HEAD(global_has_mode); static struct fb_ops vmlfb_ops; static struct vml_sys *subsys = NULL; static char *vml_default_mode = "1024x768@60"; @@ -1058,9 +1058,6 @@ static int __init vmlfb_init(void) #endif printk(KERN_DEBUG MODULE_NAME ": initializing\n"); - mutex_init(&vml_mutex); - INIT_LIST_HEAD(&global_no_mode); - INIT_LIST_HEAD(&global_has_mode); return pci_register_driver(&vmlfb_pci_driver); } _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2021-04-09 9:43 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-09 9:51 Ye Bin [this message] 2021-04-09 9:51 ` [PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head Ye Bin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210409095143.2294091-1-yebin10@huawei.com \ --to=yebin10@huawei.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=hulkci@huawei.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-fbdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.