Skip to contentSkip to conversation

drm/mediatek: Fix warning about unhandled enum value

PATCH In review Sean Paul 2 participants 3 messages May 22, 2019 – May 23, 2019

Subsystems (4)
lore
Share & tools
lore

Sean Paul

author
#0 lore raw

PATCH 1/1 drm/mediatek: Fix warning about unhandled enum value

From: Sean Paul <[email protected]>

Fixes the following build warning:
drivers/gpu/drm/mediatek/mtk_hdmi.c:327:2: warning: enumeration value ‘HDMI_INFOFRAME_TYPE_DRM’ not handled in switch [-Wswitch]

Introduced with the addition of HDMI_INFOFRAME_TYPE_DRM in the commit below, but the code really should have been future-proofed from the start.

Fixes 2cdbfd66a829 ("drm: Enable HDR infoframe support")
Cc Uma Shankar <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc "Ville Syrjälä" <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +3 -0
index e04e6c293d39..10cc9910f164 100644
@@ -341,6 +341,9 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
 		ctrl_frame_en = VS_EN;
 		ctrl_reg = GRL_ACP_ISRC_CTRL;
 		break;
+	default:
+		dev_err(hdmi->dev, "Unknown infoframe type %d\n", frame_type);
+		return;
 	}
 	mtk_hdmi_clear_bits(hdmi, ctrl_reg, ctrl_frame_en);
 	mtk_hdmi_write(hdmi, GRL_INFOFRM_TYPE, frame_type);
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Acked-by on v1 1/1
#1 lore raw

Hi, Sean:

Quoted 8 lines · Sean Paul

From: Sean Paul <[email protected]>

Fixes the following build warning:
drivers/gpu/drm/mediatek/mtk_hdmi.c:327:2: warning: enumeration value ‘HDMI_INFOFRAME_TYPE_DRM’ not handled in switch [-Wswitch]

Introduced with the addition of HDMI_INFOFRAME_TYPE_DRM in the commit below, but the code really should have been future-proofed from the start.

Quoted 2 lines
Fixes 2cdbfd66a829 ("drm: Enable HDR infoframe support")

I think "drm: Enable HDR infoframe support" exist only in drm-misc tree, could you just merge this patch to "drm: Enable HDR infoframe support"?

Regards,
CK

Quoted 23 lines
Cc Uma Shankar <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc "Ville Syrjälä" <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +0 -0
index e04e6c293d39..10cc9910f164 100644

drivers/gpu/drm/mediatek/mtk_hdmi.c static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer, · line 349

Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_hdmi.c +3 -0
@@ -341,6 +341,9 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
 		ctrl_frame_en = VS_EN;
 		ctrl_reg = GRL_ACP_ISRC_CTRL;
 		break;
+	default:
+		dev_err(hdmi->dev, "Unknown infoframe type %d\n", frame_type);
+		return;
 	}
 	mtk_hdmi_clear_bits(hdmi, ctrl_reg, ctrl_frame_en);
 	mtk_hdmi_write(hdmi, GRL_INFOFRM_TYPE, frame_type);

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#2 lore raw
Quoted 12 lines · CK Hu

Hi, Sean:

Quoted 8 lines · Sean Paul

From: Sean Paul <[email protected]>

Fixes the following build warning:
drivers/gpu/drm/mediatek/mtk_hdmi.c:327:2: warning: enumeration value ‘HDMI_INFOFRAME_TYPE_DRM’ not handled in switch [-Wswitch]

Introduced with the addition of HDMI_INFOFRAME_TYPE_DRM in the commit below, but the code really should have been future-proofed from the start.

Quoted 7 lines
Quoted 2 lines
Fixes 2cdbfd66a829 ("drm: Enable HDR infoframe support")

I think "drm: Enable HDR infoframe support" exist only in drm-misc tree, could you just merge this patch to "drm: Enable HDR infoframe support"?

Yes, I've applied it to drm-misc-next. Thanks for your Ack!

Sean

Quoted 38 lines

Regards,
CK

Quoted 32 lines
Cc Uma Shankar <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc "Ville Syrjälä" <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/mediatek/mtk_hdmi.c +3 -0
index e04e6c293d39..10cc9910f164 100644
@@ -341,6 +341,9 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
 		ctrl_frame_en = VS_EN;
 		ctrl_reg = GRL_ACP_ISRC_CTRL;
 		break;
+	default:
+		dev_err(hdmi->dev, "Unknown infoframe type %d\n", frame_type);
+		return;
 	}
 	mtk_hdmi_clear_bits(hdmi, ctrl_reg, ctrl_frame_en);
 	mtk_hdmi_write(hdmi, GRL_INFOFRM_TYPE, frame_type);
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS