Re: [PATCH can-utils-dev 4/5] candump: use linux/net_tstamp.h instead of redefining values ourselves

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 13.11.22 09:53, Vincent Mailhol wrote:
No need to redefine values when available in header.

linux/net_tstamp.h is available since Linux 2.6.30 while socket CAN
was introduced in v2.6.25. These being old releases not being
maintained any more for many years, dropping support is
acceptable.

Regardless, candump already relies on some other macros defined in
more recent kernel version (e.g. CAN_RAW_ERR_FILTER) meaning that it
would not build on old linux kernel environments.

The patch is right but this text does not fit IMO.

We have a copy of net_tstamp.h in this repository to make sure we can always build the latest binaries with the latest kernel APIs even on older development environments/kernels.

Best regards,
Oliver


Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>
---
  candump.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/candump.c b/candump.c
index 4abd2f6..8f0ca46 100644
--- a/candump.c
+++ b/candump.c
@@ -63,6 +63,7 @@
#include <linux/can.h>
  #include <linux/can/raw.h>
+#include <linux/net_tstamp.h>
#include "terminal.h"
  #include "lib.h"
@@ -72,10 +73,6 @@
  #define SO_TIMESTAMPING 37
  #endif
-/* from #include <linux/net_tstamp.h> - since Linux 2.6.30 */
-#define SOF_TIMESTAMPING_SOFTWARE (1 << 4)
-#define SOF_TIMESTAMPING_RX_SOFTWARE (1 << 3)
-#define SOF_TIMESTAMPING_RAW_HARDWARE (1 << 6)
  #define TIMESTAMPSZ 50 /* string 'absolute with date' requires max 49 bytes */
#define MAXSOCK 16 /* max. number of CAN interfaces given on the cmdline */



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux