spin_lock_irqsave(&edge_port->ep_lock, flags);
 
        /* calculate number of bytes to put in fifo */
-       copySize = min((unsigned int)count,
+       copySize = min_t(unsigned int, count,
                                (edge_port->txCredits - fifo->count));
 
        dev_dbg(&port->dev, "%s of %d byte(s) Fifo room  %d -- will copy %d bytes\n",
 
        unsigned long flags;
        unsigned char *buffer;
        struct urb *urb;
-       size_t writesize = min((size_t)count, (size_t)MAX_TRANSFER);
+       size_t writesize = min_t(size_t, count, MAX_TRANSFER);
        int retval = 0;
 
        /* verify that we actually have some data to write */