[PATCH] [video/fbdev] fb_flashcursor: Remove redundant null check

Subsystems: framebuffer console, framebuffer core, framebuffer layer, the rest

STALE2276d

2 messages, 2 authors, 2020-07-26 · open the first message on its own page

[PATCH] [video/fbdev] fb_flashcursor: Remove redundant null check

From: Gaurav Singh <hidden>
Date: 2020-07-26 05:07:26

ops cannot be NULL as its being accessed later without
checks. Remove the redundant NULL check. 

Signed-off-by: Gaurav Singh <redacted>
---
 drivers/video/fbdev/core/fbcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index e2a490c5ae08..9551f40c6d14 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -401,7 +401,7 @@ static void fb_flashcursor(struct work_struct *work)
 	if (ret = 0)
 		return;
 
-	if (ops && ops->currcon != -1)
+	if (ops->currcon != -1)
 		vc = vc_cons[ops->currcon].d;
 
 	if (!vc || !con_is_visible(vc) ||
-- 
2.17.1

Re: [PATCH] [video/fbdev] fb_flashcursor: Remove redundant null check

From: Andy Shevchenko <hidden>
Date: 2020-07-26 08:58:38

On Sun, Jul 26, 2020 at 8:17 AM Gaurav Singh [off-list ref] wrote:
ops cannot be NULL as its being accessed later without
it's
checks. Remove the redundant NULL check.
Commit message doesn't clarify why your fix is the correct one.
Maybe it's the other way around, missed check in the rest of the code there?

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help