lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1523433490-4032-1-git-send-email-baijiaju1990@gmail.com>
Date:   Wed, 11 Apr 2018 15:58:10 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     thierry.reding@...il.com, airlied@...ux.ie
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] panel-jdi-lt070me05000: Replace mdelay with usleep_range and msleep in jdi_panel_init

jdi_panel_init() is never called in atomic context.

Despite never getting called from atomic context, jdi_panel_init()
calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() 
and msleep() to avoid busy waiting.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
index 5b2340e..46b12a6 100644
--- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
@@ -128,7 +128,7 @@ static int jdi_panel_init(struct jdi_panel *jdi)
 		return ret;
 	}
 
-	mdelay(10);
+	usleep_range(10000, 11000);
 
 	/* Interface setting, video mode */
 	ret = mipi_dsi_generic_write(dsi, (u8[])
@@ -139,7 +139,7 @@ static int jdi_panel_init(struct jdi_panel *jdi)
 		return ret;
 	}
 
-	mdelay(20);
+	msleep(20);
 
 	ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x03}, 2);
 	if (ret < 0) {
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ