diff mbox series

[net,v2] ptp: ptp_clockmatrix: fix is_single_shot

Message ID 1653403501-12621-1-git-send-email-min.li.xe@renesas.com (mailing list archive)
State Accepted
Commit d0bbe0328fe552ff3211b3cbbf6117a885a3d5b2
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] 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 24, 2022, 2:45 p.m. UTC
is_single_shot should return false for the power_of_2 mask

Fixes: b95fcd0e776f ("ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support")
Signed-off-by: Min Li <min.li.xe@renesas.com>
---
-Add Fixes tag

 drivers/ptp/ptp_clockmatrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 26, 2022, 5 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 24 May 2022 10:45:01 -0400 you wrote:
> is_single_shot should return false for the power_of_2 mask
> 
> Fixes: b95fcd0e776f ("ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support")
> Signed-off-by: Min Li <min.li.xe@renesas.com>
> ---
> -Add Fixes tag
> 
> [...]

Here is the summary with links:
  - [net,v2] ptp: ptp_clockmatrix: fix is_single_shot
    https://git.kernel.org/netdev/net/c/d0bbe0328fe5

You are awesome, thank you!
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,