Skip to contentSkip to conversation

omapfb/dss: fix comparison to bool warning

PATCH Applied Jason Yan 3 participants 3 messages Apr 22, 2020 – Jun 1, 2020

Subsystems (2)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 omapfb/dss: fix comparison to bool warning

Fix the following coccicheck warning:

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c:461:15-32: WARNING:
Comparison to bool drivers/video/fbdev/omap2/omapfb/dss/dispc.c:891:5-35: WARNING:
Comparison of 0/1 to bool variable

---
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/dispc.c +1 -1
index 4a16798b2ecd..3bb951eb29c7 100644
@@ -888,7 +888,7 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane,
 static void dispc_ovl_configure_burst_type(enum omap_plane plane,
 		enum omap_dss_rotation_type rotation_type)
 {
-	if (dss_has_feature(FEAT_BURST_2D) = 0)
+	if (!dss_has_feature(FEAT_BURST_2D))
 		return;
 
 	if (rotation_type = OMAP_DSS_ROT_TILER)
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +1 -3
index 7060ae56c062..ef659c89ba58 100644
@@ -455,11 +455,9 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,
 static int hdmi_read_edid(struct omap_dss_device *dssdev,
 		u8 *edid, int len)
 {
-	bool need_enable;
+	bool need_enable = !hdmi.core_enabled;
 	int r;
 
-	need_enable = hdmi.core_enabled = false;
-
 	if (need_enable) {
 		r = hdmi_core_enable(dssdev);
 		if (r)
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jason Yan

Fix the following coccicheck warning:

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c:461:15-32: WARNING:
Comparison to bool drivers/video/fbdev/omap2/omapfb/dss/dispc.c:891:5-35: WARNING:
Comparison of 0/1 to bool variable

Quoted 5 lines
---
  drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 2 +-
  drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 4 +---
  2 files changed, 2 insertions(+), 4 deletions(-)

Tomi

Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#2 lore raw
In reply to Jason Yan
Quoted 8 lines · Jason Yan

Fix the following coccicheck warning:

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c:461:15-32: WARNING:
Comparison to bool drivers/video/fbdev/omap2/omapfb/dss/dispc.c:891:5-35: WARNING:
Comparison of 0/1 to bool variable

Applied to drm-misc-next tree (patch should show up in v5.9), thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 36 lines
---
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/dispc.c +1 -1
index 4a16798b2ecd..3bb951eb29c7 100644
@@ -888,7 +888,7 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane,
 static void dispc_ovl_configure_burst_type(enum omap_plane plane,
 		enum omap_dss_rotation_type rotation_type)
 {
-	if (dss_has_feature(FEAT_BURST_2D) = 0)
+	if (!dss_has_feature(FEAT_BURST_2D))
 		return;
 
 	if (rotation_type = OMAP_DSS_ROT_TILER)
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +1 -3
index 7060ae56c062..ef659c89ba58 100644
@@ -455,11 +455,9 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev,
 static int hdmi_read_edid(struct omap_dss_device *dssdev,
 		u8 *edid, int len)
 {
-	bool need_enable;
+	bool need_enable = !hdmi.core_enabled;
 	int r;
 
-	need_enable = hdmi.core_enabled = false;
-
 	if (need_enable) {
 		r = hdmi_core_enable(dssdev);
 		if (r)