[PATCH -next] video: fbdev: vermilion: use DEFINE_MUTEX() for mutex lock and LIST_HEAD() for list head

2021-04-09 Thread Ye Bin
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 
Signed-off-by: Ye Bin 
---
 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(_mutex);
-   INIT_LIST_HEAD(_no_mode);
-   INIT_LIST_HEAD(_has_mode);
 
return pci_register_driver(_pci_driver);
 }

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/nouveau: remove set but not used variable ‘pdev’ in nouveau_bios_init

2021-01-23 Thread Ye Bin
Fix follow warning:
drivers/gpu/drm/nouveau/nouveau_bios.c:2086:18: warning: variable ‘pdev’ set 
but not used [-Wunused-but-set-variable]
  struct pci_dev *pdev;
  ^~~~

Reported-by: Hulk Robot 
Signed-off-by: Ye Bin 
---
 drivers/gpu/drm/nouveau/nouveau_bios.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c 
b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 7cc683b8dc7a..e8c445eb1100 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -2083,13 +2083,11 @@ nouveau_bios_init(struct drm_device *dev)
 {
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvbios *bios = >vbios;
-   struct pci_dev *pdev;
int ret;
 
/* only relevant for PCI devices */
if (!dev_is_pci(dev->dev))
return 0;
-   pdev = to_pci_dev(dev->dev);
 
if (!NVInitVBIOS(dev))
return -ENODEV;
-- 
2.25.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel