[PATCH 1/3] Revert "cpukit/dev/can: Resolve warnings in 64bit builds"

Gedare Bloom gedare at rtems.org
Thu Jul 27 18:28:19 UTC 2023


This reverts commit 4c0a2d47e1dce0923f270d0206d0cb93d0d58451.
---
 cpukit/dev/can/can.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/cpukit/dev/can/can.c b/cpukit/dev/can/can.c
index 9f3fe0db98..2e6d5df65b 100644
--- a/cpukit/dev/can/can.c
+++ b/cpukit/dev/can/can.c
@@ -34,7 +34,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <inttypes.h>
 #include <string.h>
 #include <stdlib.h>
 
@@ -58,13 +57,13 @@
                            real_can_interrupt_lock_release(bus);  \
                          } while (0);
 
-static int
+static ssize_t 
 can_bus_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode);
 static ssize_t 
 can_bus_read(rtems_libio_t *iop, void *buffer, size_t count);
 static ssize_t 
 can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count);
-static int
+static ssize_t 
 can_bus_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer);
 
 static int can_xmit(struct can_bus *bus);
@@ -180,7 +179,7 @@ static int try_sem(struct can_bus *bus)
   return ret;
 }
 
-static int
+static ssize_t 
 can_bus_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
 {
   CAN_DEBUG("can_bus_open\n");
@@ -211,8 +210,7 @@ static ssize_t can_bus_read(rtems_libio_t *iop, void *buffer, size_t count)
   len = CAN_MSG_LEN(&bus->can_rx_msg);
 
   if (count < len) {
-    CAN_DEBUG("can_bus_read: buffer size is small min "
-              "sizeof(struct can_msg) = %" PRIuPTR "\n",
+    CAN_DEBUG("can_bus_read: buffer size is small min sizeof(struct can_msg) = %u\n",
                     sizeof(struct can_msg));
     return -RTEMS_INVALID_SIZE;
   }
@@ -316,8 +314,8 @@ can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count)
 
   CAN_DEBUG_TX("can_bus_write: can_msg_size = %u\n", msg_size);
   if (msg_size > sizeof(struct can_msg)) {
-    CAN_ERR("can_bus_write: can message "
-            "len error msg_size = %u struct can_msg = %" PRIxPTR "\n",
+    CAN_ERR("can_bus_write:"
+          "can message len error msg_size = %u struct can_msg = %u\n", 
           msg_size, sizeof(struct can_msg));
     return -RTEMS_INVALID_SIZE;
   }
@@ -365,7 +363,7 @@ release_lock_and_return:
   return ret;
 }
 
-static int
+static ssize_t 
 can_bus_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
 {
   can_bus *bus = IMFS_generic_get_context_by_iop(iop);
-- 
2.34.1



More information about the devel mailing list