[PATCH 2/4] cpukit/dev/can: Removed extra debug prints in CAN Framework

Prashanth S fishesprashanth at gmail.com
Fri Dec 16 13:27:50 UTC 2022


---
 cpukit/dev/can/can.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/cpukit/dev/can/can.c b/cpukit/dev/can/can.c
index 2e6d5df65b..7098ce16c2 100644
--- a/cpukit/dev/can/can.c
+++ b/cpukit/dev/can/can.c
@@ -73,19 +73,14 @@ static int try_sem(struct can_bus *);
 static int take_sem(struct can_bus *);
 static int give_sem(struct can_bus *);
 
-
 static void can_bus_obtain(can_bus *bus)
 {
-  CAN_DEBUG("can_bus_obtain Entry\n");
   rtems_mutex_lock(&bus->mutex);
-  CAN_DEBUG("can_bus_obtain Exit\n");
 }
 
 static void can_bus_release(can_bus *bus)
 {
-  CAN_DEBUG("can_bus_release Entry\n");
   rtems_mutex_unlock(&bus->mutex);
-  CAN_DEBUG("can_bus_release Exit\n");
 }
 
 static void can_bus_destroy_mutex(struct can_bus *bus)
@@ -182,8 +177,6 @@ static int try_sem(struct can_bus *bus)
 static ssize_t 
 can_bus_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
 {
-  CAN_DEBUG("can_bus_open\n");
-
   return 0;
 } 
 
@@ -231,21 +224,16 @@ static int can_xmit(struct can_bus *bus)
 
   struct can_msg *msg = NULL;
 
-  CAN_DEBUG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> can_xmit Entry\n");
-
   while (1) {
-    CAN_DEBUG("can_dev_ops->dev_tx_ready\n");
     if (bus->can_dev_ops->dev_tx_ready(bus->priv) != true) {
       break;
     }
 
-    CAN_DEBUG("can_tx_get_data_buf\n");
     msg = can_bus_tx_get_data_buf(bus);
     if (msg == NULL) {
       break;
     }
 
-    CAN_DEBUG("can_dev_ops->dev_tx\n");
     ret = bus->can_dev_ops->dev_tx(bus->priv, msg);
     if (ret != RTEMS_SUCCESSFUL) {
         CAN_ERR("can_xmit: dev_send failed\n");
@@ -259,8 +247,6 @@ static int can_xmit(struct can_bus *bus)
     }
   }
 
-  CAN_DEBUG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> can_xmit Exit\n");
-
   return ret;
 }
 
@@ -284,13 +270,11 @@ void can_print_msg(struct can_msg const *msg)
 /* can_tx_done should be called only with CAN interrupts disabled */
 int can_tx_done(struct can_bus *bus)
 {
-  CAN_DEBUG("------------ can_tx_done Entry\n");
   int ret = RTEMS_SUCCESSFUL;
 
   if (bus->can_dev_ops->dev_tx_ready(bus->priv) == true) {
     ret = can_xmit(bus);
   }
-  CAN_DEBUG("------------ can_tx_done Exit\n");
   
   return ret;
 }
@@ -312,7 +296,6 @@ can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count)
 
   uint32_t msg_size = CAN_MSG_LEN(msg);
 
-  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 = %u\n", 
@@ -343,9 +326,7 @@ can_bus_write(rtems_libio_t *iop, const void *buffer, size_t count)
     goto release_lock_and_return;
   }
 
-  CAN_DEBUG_TX("can_bus_write: empty_count = %u\n", bus->tx_fifo.empty_count);
 
-  CAN_DEBUG_TX("can_bus_write: copying msg from application to driver buffer\n");
   memcpy(fifo_buf, msg, msg_size);
 
   if (bus->can_dev_ops->dev_tx_ready(bus->priv) == true) {
@@ -426,7 +407,6 @@ rtems_status_code can_bus_register(can_bus *bus, const char *bus_path)
   }
 
   bus->index = index++;
-  CAN_DEBUG("Registering CAN bus index = %u\n", bus->index);
 
   ret = IMFS_make_generic_node(bus_path, S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
                               &can_bus_node_control, bus);
-- 
2.25.1



More information about the devel mailing list