Skip to contentSkip to conversation

drm/amd/display: Fix link_detect_sink()

PATCH In review Dan Carpenter 2 participants 3 messages Apr 6, 2020 – Apr 7, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix link_detect_sink()

This TODO stub originally had curly braces but we deleted them as part of a clean up. Unfortunately that changes the behavior of the code because now the switch statement is part of the if statement. Smatch complains that the indenting doesn't make sense.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:425 link_detect_sink() warn: if statement not indented

Also I changed "ZAZTODO" to just "TODO". The ZAZ isn't used anywhere else.

Fixes 621514aa4140 ("drm/amd/display: codestyle cleanup on dc_link file until detect_dp func")

---
Another idea is we should just delete this stub. Stub code is generally against kernel style. I can send a V2 if people want.

 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index a93997ff0419..188670d374a3 100644
@@ -423,7 +423,7 @@ static enum signal_type link_detect_sink(struct dc_link *link,
 
 	/* PCIE detects the actual connector on add-on board */
 	if (link->link_id.id = CONNECTOR_ID_PCIE)
-		/* ZAZTODO implement PCIE add-on card detection */
+		; /* TODO implement PCIE add-on card detection */
 
 	switch (link->link_id.id) {
 	case CONNECTOR_ID_HDMI_TYPE_A: {
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

This TODO stub originally had curly braces but we deleted them as part of a clean up. Unfortunately that changes the behavior of the code because now the switch statement is part of the if statement. Smatch complains that the indenting doesn't make sense.

Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:425 link_detect_sink() warn: if statement not indented

Also I changed "ZAZTODO" to just "TODO". The ZAZ isn't used anywhere else.

Fixes 621514aa4140 ("drm/amd/display: codestyle cleanup on dc_link file until detect_dp func")

I'd prefer just dropping the block, but either method is:

Since that previous patch broke most sink detection...

Regards,
Nicholas Kazlauskas

Quoted 21 lines

---
Another idea is we should just delete this stub. Stub code is generally against kernel style. I can send a V2 if people want.

  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index a93997ff0419..188670d374a3 100644
@@ -423,7 +423,7 @@ static enum signal_type link_detect_sink(struct dc_link *link,
 
  	/* PCIE detects the actual connector on add-on board */
  	if (link->link_id.id = CONNECTOR_ID_PCIE)
-		/* ZAZTODO implement PCIE add-on card detection */
+		; /* TODO implement PCIE add-on card detection */
 
  	switch (link->link_id.id) {
  	case CONNECTOR_ID_HDMI_TYPE_A: {
#2 lore raw
Quoted 12 lines · Nicholas
Quoted 11 lines · Dan Carpenter

This TODO stub originally had curly braces but we deleted them as part of a clean up. Unfortunately that changes the behavior of the code because now the switch statement is part of the if statement. Smatch complains that the indenting doesn't make sense.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:425 link_detect_sink() warn: if statement not indented

Also I changed "ZAZTODO" to just "TODO". The ZAZ isn't used anywhere else.

Quoted 9 lines
Quoted 2 lines
Fixes 621514aa4140 ("drm/amd/display: codestyle cleanup on dc_link file until detect_dp func")

I'd prefer just dropping the block, but either method is:

Since that previous patch broke most sink detection...

Sorry for the net-next in the subject. Anyway, this was fixed in commit 50dc581a8f43 ("drm/amd/display: fix the broken logic in dc_link.c") so no need for me to resend.

regards,
dan carpenter