* [net-next:master 1917/1931] drivers/net/ethernet/sfc/ptp.c:646:3: warning: this decimal constant is unsigned only in ISO C90
@ 2018-01-25 22:33 kbuild test robot
2018-01-26 8:51 ` [PATCH net-next] sfc: add suffix to large constant in ptp Bert Kenward
0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2018-01-25 22:33 UTC (permalink / raw)
To: Edward Cree; +Cc: kbuild-all, netdev
[-- Attachment #1: Type: text/plain, Size: 4663 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: fdd6d771c7de9d351c6dbdbab5bdc83805c06955
commit: 1280c0f8aafc4c09c59c576c8d50f367070b2619 [1917/1931] sfc: support second + quarter ns time format for receive datapath
config: i386-randconfig-s1-201803 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
git checkout 1280c0f8aafc4c09c59c576c8d50f367070b2619
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/net/ethernet/sfc/ptp.c: In function 'efx_ptp_get_attributes':
>> drivers/net/ethernet/sfc/ptp.c:646:3: warning: this decimal constant is unsigned only in ISO C90
ptp->nic_time.minor_max = 4000000000;
^~~
vim +646 drivers/net/ethernet/sfc/ptp.c
598
599 /* Get PTP attributes and set up time conversions */
600 static int efx_ptp_get_attributes(struct efx_nic *efx)
601 {
602 MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_GET_ATTRIBUTES_LEN);
603 MCDI_DECLARE_BUF(outbuf, MC_CMD_PTP_OUT_GET_ATTRIBUTES_LEN);
604 struct efx_ptp_data *ptp = efx->ptp_data;
605 int rc;
606 u32 fmt;
607 size_t out_len;
608
609 /* Get the PTP attributes. If the NIC doesn't support the operation we
610 * use the default format for compatibility with older NICs i.e.
611 * seconds and nanoseconds.
612 */
613 MCDI_SET_DWORD(inbuf, PTP_IN_OP, MC_CMD_PTP_OP_GET_ATTRIBUTES);
614 MCDI_SET_DWORD(inbuf, PTP_IN_PERIPH_ID, 0);
615 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf),
616 outbuf, sizeof(outbuf), &out_len);
617 if (rc == 0) {
618 fmt = MCDI_DWORD(outbuf, PTP_OUT_GET_ATTRIBUTES_TIME_FORMAT);
619 } else if (rc == -EINVAL) {
620 fmt = MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS;
621 } else if (rc == -EPERM) {
622 netif_info(efx, probe, efx->net_dev, "no PTP support\n");
623 return rc;
624 } else {
625 efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf),
626 outbuf, sizeof(outbuf), rc);
627 return rc;
628 }
629
630 switch (fmt) {
631 case MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_27FRACTION:
632 ptp->ns_to_nic_time = efx_ptp_ns_to_s27;
633 ptp->nic_to_kernel_time = efx_ptp_s27_to_ktime_correction;
634 ptp->nic_time.minor_max = 1 << 27;
635 ptp->nic_time.sync_event_minor_shift = 19;
636 break;
637 case MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_NANOSECONDS:
638 ptp->ns_to_nic_time = efx_ptp_ns_to_s_ns;
639 ptp->nic_to_kernel_time = efx_ptp_s_ns_to_ktime_correction;
640 ptp->nic_time.minor_max = 1000000000;
641 ptp->nic_time.sync_event_minor_shift = 22;
642 break;
643 case MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_QTR_NANOSECONDS:
644 ptp->ns_to_nic_time = efx_ptp_ns_to_s_qns;
645 ptp->nic_to_kernel_time = efx_ptp_s_qns_to_ktime_correction;
> 646 ptp->nic_time.minor_max = 4000000000;
647 ptp->nic_time.sync_event_minor_shift = 24;
648 break;
649 default:
650 return -ERANGE;
651 }
652
653 /* Precalculate acceptable difference between the minor time in the
654 * packet prefix and the last MCDI time sync event. We expect the
655 * packet prefix timestamp to be after of sync event by up to one
656 * sync event interval (0.25s) but we allow it to exceed this by a
657 * fuzz factor of (0.1s)
658 */
659 ptp->nic_time.sync_event_diff_min = ptp->nic_time.minor_max
660 - (ptp->nic_time.minor_max / 10);
661 ptp->nic_time.sync_event_diff_max = (ptp->nic_time.minor_max / 4)
662 + (ptp->nic_time.minor_max / 10);
663
664 /* MC_CMD_PTP_OP_GET_ATTRIBUTES has been extended twice from an older
665 * operation MC_CMD_PTP_OP_GET_TIME_FORMAT. The function now may return
666 * a value to use for the minimum acceptable corrected synchronization
667 * window and may return further capabilities.
668 * If we have the extra information store it. For older firmware that
669 * does not implement the extended command use the default value.
670 */
671 if (rc == 0 &&
672 out_len >= MC_CMD_PTP_OUT_GET_ATTRIBUTES_CAPABILITIES_OFST)
673 ptp->min_synchronisation_ns =
674 MCDI_DWORD(outbuf,
675 PTP_OUT_GET_ATTRIBUTES_SYNC_WINDOW_MIN);
676 else
677 ptp->min_synchronisation_ns = DEFAULT_MIN_SYNCHRONISATION_NS;
678
679 return 0;
680 }
681
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32481 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next] sfc: add suffix to large constant in ptp
2018-01-25 22:33 [net-next:master 1917/1931] drivers/net/ethernet/sfc/ptp.c:646:3: warning: this decimal constant is unsigned only in ISO C90 kbuild test robot
@ 2018-01-26 8:51 ` Bert Kenward
2018-01-26 15:47 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Bert Kenward @ 2018-01-26 8:51 UTC (permalink / raw)
To: Dave Miller; +Cc: netdev, linux-net-drivers, kbuild-all, kbuild test robot
Fixes: 1280c0f8aafc ("sfc: support second + quarter ns time format for receive datapath")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
---
drivers/net/ethernet/sfc/ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 433d29d6bc95..f1cc2ed76029 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -643,7 +643,7 @@ static int efx_ptp_get_attributes(struct efx_nic *efx)
case MC_CMD_PTP_OUT_GET_ATTRIBUTES_SECONDS_QTR_NANOSECONDS:
ptp->ns_to_nic_time = efx_ptp_ns_to_s_qns;
ptp->nic_to_kernel_time = efx_ptp_s_qns_to_ktime_correction;
- ptp->nic_time.minor_max = 4000000000;
+ ptp->nic_time.minor_max = 4000000000UL;
ptp->nic_time.sync_event_minor_shift = 24;
break;
default:
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sfc: add suffix to large constant in ptp
2018-01-26 8:51 ` [PATCH net-next] sfc: add suffix to large constant in ptp Bert Kenward
@ 2018-01-26 15:47 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2018-01-26 15:47 UTC (permalink / raw)
To: bkenward; +Cc: netdev, linux-net-drivers, kbuild-all, fengguang.wu
From: Bert Kenward <bkenward@solarflare.com>
Date: Fri, 26 Jan 2018 08:51:47 +0000
> Fixes: 1280c0f8aafc ("sfc: support second + quarter ns time format for receive datapath")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-26 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25 22:33 [net-next:master 1917/1931] drivers/net/ethernet/sfc/ptp.c:646:3: warning: this decimal constant is unsigned only in ISO C90 kbuild test robot
2018-01-26 8:51 ` [PATCH net-next] sfc: add suffix to large constant in ptp Bert Kenward
2018-01-26 15:47 ` David Miller
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).