+ canque_edge_unlock_both_ends(inends, outends, flags);
+ if(dead_fl) canque_edge_do_dead(edge);
+}
+
+#ifndef CAN_HAVE_ARCH_CMPXCHG
+/**
+ * canque_edge_decref - decrements edge reference count
+ * @edge: pointer to the edge structure
+ *
+ * This function has to be called without lock held for both ends of edge.
+ * If reference count drops to 0, function canque_edge_do_dead()
+ * is called.
+ */
+static inline
+void canque_edge_decref(struct canque_edge_t *edge)
+{
+ __canque_edge_decref_body(edge);
+}
+#else
+static inline
+void canque_edge_decref(struct canque_edge_t *edge)
+{
+ int x, y;
+
+ x = atomic_read(&edge->edge_used);
+ do{
+ if(x<=1)
+ return __canque_edge_decref(edge);
+ y=x;
+ /* This code strongly depends on the definition of atomic_t !!!! */
+ /* x=cmpxchg(&edge->edge_used, x, x-1); */
+ /* Next alternative could be more portable */
+ x=__cmpxchg(&edge->edge_used, x, x-1, sizeof(atomic_t));
+ /* If even this does not help, comment out CAN_HAVE_ARCH_CMPXCHG in can_sysdep.h */
+ } while(x!=y);