diff mbox series

[net] ptp: ptp_clockmatrix: fix is_single_shot

Message ID 1652988059-8740-1-git-send-email-min.li.xe@renesas.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] ptp: ptp_clockmatrix: fix is_single_shot | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/apply fail Patch does not apply to net

Commit Message

Min Li May 19, 2022, 7:20 p.m. UTC
is_single_shot should return false for the power_of_2 mask

Signed-off-by: Min Li <min.li.xe@renesas.com>
---
 drivers/ptp/ptp_clockmatrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski May 19, 2022, 11:46 p.m. UTC | #1
On Thu, 19 May 2022 15:20:59 -0400 Min Li wrote:
> Subject: [PATCH net] ptp: ptp_clockmatrix: fix is_single_shot

I put your patches in net-next, because I could not understand
whether they were a bug fix or a feature. Please resend this
with [PATCH net-next]

> is_single_shot should return false for the power_of_2 mask
> 
> Signed-off-by: Min Li <min.li.xe@renesas.com>

And since this clearly is a bug fix it'll need a Fixes: tag.
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index cb258e1..c9d451b 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -267,7 +267,7 @@  static int arm_tod_read_trig_sel_refclk(struct idtcm_channel *channel, u8 ref)
 static bool is_single_shot(u8 mask)
 {
 	/* Treat single bit ToD masks as continuous trigger */
-	return mask <= 8 && is_power_of_2(mask);
+	return !(mask <= 8 && is_power_of_2(mask));
 }
 
 static int idtcm_extts_enable(struct idtcm_channel *channel,