linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head
@ 2021-04-09  9:51 Ye Bin
  0 siblings, 0 replies; only message in thread
From: Ye Bin @ 2021-04-09  9:51 UTC (permalink / raw)
  To: yebin10; +Cc: dri-devel, linux-fbdev, kernel-janitors, Hulk Robot

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);
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-09  9:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  9:51 [PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head Ye Bin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).