Skip to contentSkip to conversation

staging: most: dim2: remove unnecessary NULL check in service_done_flag()

PATCH New [email protected] 1 participant 1 message Mar 31

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

PATCH 1/1 staging: most: dim2: remove unnecessary NULL check in service_done_flag()

From: Gabriel Rondon <[email protected]>

Remove the !hdm_ch check. hdm_ch is derived from dev->hch + ch_idx (pointer arithmetic on a struct member), so it can never be NULL. Keep only the !hdm_ch->is_initialized check.

---
 drivers/staging/most/dim2/dim2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/dim2/dim2.c +1 -1
index 7953d4626..f5bd7d44f 100644
@@ -271,7 +271,7 @@ static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
 	unsigned long flags;
 	u8 *data;
 
-	if (!hdm_ch || !hdm_ch->is_initialized)
+	if (!hdm_ch->is_initialized)
 		return;
 
 	spin_lock_irqsave(&dim_lock, flags);
Signature · 1 line
2.33.0