netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bnxt_en: silence clang build warning
@ 2024-05-09 15:18 Vadim Fedorenko
  2024-05-09 16:06 ` Michael Chan
  2024-05-11  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Vadim Fedorenko @ 2024-05-09 15:18 UTC (permalink / raw)
  To: Michael Chan, Jakub Kicinski; +Cc: Vadim Fedorenko, netdev

Clang build brings a warning:

    ../drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:133:12: warning:
    comparison of distinct pointer types ('typeof (tmo_us) *' (aka 'unsigned
    int *') and 'typeof (65535) *' (aka 'int *'))
    [-Wcompare-distinct-pointer-types]
      133 |                 tmo_us = min(tmo_us, BNXT_PTP_QTS_MAX_TMO_US);
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix it by specifying proper type for BNXT_PTP_QTS_MAX_TMO_US.

Fixes: 7de3c2218eed ("bnxt_en: Add a timeout parameter to bnxt_hwrm_port_ts_query()")
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
index 6a2bba3f9e2d..2c3415c8fc03 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
@@ -24,7 +24,7 @@
 
 #define BNXT_PTP_DFLT_TX_TMO	1000 /* ms */
 #define BNXT_PTP_QTS_TIMEOUT	1000
-#define BNXT_PTP_QTS_MAX_TMO_US	65535
+#define BNXT_PTP_QTS_MAX_TMO_US	65535U
 #define BNXT_PTP_QTS_TX_ENABLES	(PORT_TS_QUERY_REQ_ENABLES_PTP_SEQ_ID |	\
 				 PORT_TS_QUERY_REQ_ENABLES_TS_REQ_TIMEOUT | \
 				 PORT_TS_QUERY_REQ_ENABLES_PTP_HDR_OFFSET)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] bnxt_en: silence clang build warning
  2024-05-09 15:18 [PATCH net] bnxt_en: silence clang build warning Vadim Fedorenko
@ 2024-05-09 16:06 ` Michael Chan
  2024-05-11  1:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2024-05-09 16:06 UTC (permalink / raw)
  To: Vadim Fedorenko; +Cc: Jakub Kicinski, netdev

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

On Thu, May 9, 2024 at 8:16 AM Vadim Fedorenko
<vadim.fedorenko@linux.dev> wrote:
>
> Clang build brings a warning:
>
>     ../drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:133:12: warning:
>     comparison of distinct pointer types ('typeof (tmo_us) *' (aka 'unsigned
>     int *') and 'typeof (65535) *' (aka 'int *'))
>     [-Wcompare-distinct-pointer-types]
>       133 |                 tmo_us = min(tmo_us, BNXT_PTP_QTS_MAX_TMO_US);
>           |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix it by specifying proper type for BNXT_PTP_QTS_MAX_TMO_US.
>
> Fixes: 7de3c2218eed ("bnxt_en: Add a timeout parameter to bnxt_hwrm_port_ts_query()")
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

Thanks.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] bnxt_en: silence clang build warning
  2024-05-09 15:18 [PATCH net] bnxt_en: silence clang build warning Vadim Fedorenko
  2024-05-09 16:06 ` Michael Chan
@ 2024-05-11  1:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-11  1:30 UTC (permalink / raw)
  To: Vadim Fedorenko; +Cc: michael.chan, kuba, netdev

Hello:

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

On Thu,  9 May 2024 15:18:33 +0000 you wrote:
> Clang build brings a warning:
> 
>     ../drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:133:12: warning:
>     comparison of distinct pointer types ('typeof (tmo_us) *' (aka 'unsigned
>     int *') and 'typeof (65535) *' (aka 'int *'))
>     [-Wcompare-distinct-pointer-types]
>       133 |                 tmo_us = min(tmo_us, BNXT_PTP_QTS_MAX_TMO_US);
>           |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net] bnxt_en: silence clang build warning
    https://git.kernel.org/netdev/net-next/c/38155539a16e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-11  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 15:18 [PATCH net] bnxt_en: silence clang build warning Vadim Fedorenko
2024-05-09 16:06 ` Michael Chan
2024-05-11  1:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).