Skip to contentSkip to conversation

drm/nouveau: move assignment out of condition and fix spacing

PATCH New [email protected] 1 participant 1 message Aug 18, 2025

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

PATCH 1/1 drm/nouveau: move assignment out of condition and fix spacing

From: Darshan Rathod <[email protected]>

Simplify conditional logic by moving the assignment of pll_lim.reg to reg1 out of the if() statement. Also adjust spacing in an if() statement for consistency with kernel style.

---
 drivers/gpu/drm/nouveau/dispnv04/hw.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/dispnv04/hw.c +4 -2
index 8b376f9c8746..165ba41422a5 100644
@@ -172,7 +172,9 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype,
 	int ret;
 
 	ret = nvbios_pll_parse(bios, plltype, &pll_lim);
-	if (ret || !(reg1 = pll_lim.reg))
+	reg1 = pll_lim.reg;
+
+	if (ret || !reg1)
 		return -ENOENT;
 
 	pll1 = nvif_rd32(device, reg1);
@@ -747,7 +749,7 @@ nv_load_state_ext(struct drm_device *dev, int head,
 			/* Not waiting for vertical retrace before modifying
 			   CRE_53/CRE_54 causes lockups. */
 			nvif_msec(&drm->client.device, 650,
-				if ( (nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8))
+				if ((nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8))
 					break;
 			);
 			nvif_msec(&drm->client.device, 650,
Signature · 1 line
2.25.1