Skip to contentSkip to conversation

drm/panel: ili9341: Remove a superfluous else after return

PATCH Superseded Sui Jingfeng 2 participants 3 messages Apr 29, 2024 – Apr 30, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panel: ili9341: Remove a superfluous else after return

The else clause after the ruturn clause is not useful.

---
 drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +2 -1
index 3574681891e8..433572c4caf9 100644
@@ -722,7 +722,8 @@ static int ili9341_probe(struct spi_device *spi)
 
 	if (!strcmp(id->name, "sf-tc240t-9370-t"))
 		return ili9341_dpi_probe(spi, dc, reset);
-	else if (!strcmp(id->name, "yx240qv29"))
+
+	if (!strcmp(id->name, "yx240qv29"))
 		return ili9341_dbi_probe(spi, dc, reset);
 
 	return -1;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Sui Jingfeng

The else clause after the ruturn clause is not useful.

Hi Sui,

Spelling nit: ruturn --> return

Besides that,

Thanks,

Jessica Zhang

Quoted 23 lines
---
  drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9341.c +2 -1
index 3574681891e8..433572c4caf9 100644
@@ -722,7 +722,8 @@ static int ili9341_probe(struct spi_device *spi)
 
  	if (!strcmp(id->name, "sf-tc240t-9370-t"))
  		return ili9341_dpi_probe(spi, dc, reset);
-	else if (!strcmp(id->name, "yx240qv29"))
+
+	if (!strcmp(id->name, "yx240qv29"))
  		return ili9341_dbi_probe(spi, dc, reset);
 
  	return -1;
Signature · 1 line
2.34.1
#2 lore raw

Hi,

Quoted 9 lines · Jessica Zhang
Quoted 1 line · Sui Jingfeng

The else clause after the ruturn clause is not useful.

Hi Sui,

Spelling nit: ruturn --> return

Thanks for pointed out, will be fixed.

Quoted 7 lines

Besides that,

Thanks,

Jessica Zhang

Thanks, Jessica.