[lvc-project] [PATCH] ptp: ocp: Remove redundant check in _signal_summary_show

Ivan Abramov i.abramov at mt-integration.ru
Wed Mar 5 12:25:20 MSK 2025


In the function _signal_summary_show(), there is a NULL-check for
&bp->signal[nr], which cannot actually be NULL.

Therefore, this redundant check can be removed.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Ivan Abramov <i.abramov at mt-integration.ru>
---
 drivers/ptp/ptp_ocp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index b651087f426f..34c616bd0a02 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -3959,9 +3959,6 @@ _signal_summary_show(struct seq_file *s, struct ptp_ocp *bp, int nr)
 	bool on;
 	u32 val;
 
-	if (!signal)
-		return;
-
 	on = signal->running;
 	sprintf(label, "GEN%d", nr + 1);
 	seq_printf(s, "%7s: %s, period:%llu duty:%d%% phase:%llu pol:%d",
-- 
2.48.1




More information about the lvc-project mailing list