Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
[linux-2.6-microblaze.git] / drivers / staging / rdma / hfi1 / pio_copy.c
index 228e9fb..8c25e1b 100644 (file)
@@ -236,7 +236,7 @@ static inline void read_extra_bytes(struct pio_buf *pbuf,
        while (nbytes) {
                /* find the number of bytes in this u64 */
                room = 8 - off; /* this u64 has room for this many bytes */
-               xbytes = nbytes > room ? room : nbytes;
+               xbytes = min(room, nbytes);
 
                /*
                 * shift down to zero lower bytes, shift up to zero upper
@@ -570,7 +570,7 @@ static void mid_copy_mix(struct pio_buf *pbuf, const void *from, size_t nbytes)
                 * comes first
                 */
                send = pbuf->start + PIO_BLOCK_SIZE;
-               xend = send < dend ? send : dend;
+               xend = min(send, dend);
 
                /* shift up to SOP=1 space */
                dest += SOP_DISTANCE;
@@ -666,7 +666,7 @@ static void mid_copy_straight(struct pio_buf *pbuf,
                 * comes first
                 */
                send = pbuf->start + PIO_BLOCK_SIZE;
-               xend = send < dend ? send : dend;
+               xend = min(send, dend);
 
                /* shift up to SOP=1 space */
                dest += SOP_DISTANCE;