]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/gdsys/p1022/controlcenterd-id.c
linux/kernel.h: sync min, max, min3, max3 macros with Linux
[people/ms/u-boot.git] / board / gdsys / p1022 / controlcenterd-id.c
index 70eff912aa6bc7d99634d101e7b54225c61f98b4..317669b9ab180190207c70ec5258520f461fd2e8 100644 (file)
@@ -236,7 +236,7 @@ static int ccdm_mmc_read(struct mmc *mmc, u64 src, u8 *dst, int size)
                        tmp_buf);
                if (!n)
                        goto failure;
-               result = min(size, blk_len - ofs);
+               result = min(size, (int)(blk_len - ofs));
                memcpy(dst, tmp_buf + ofs, result);
                dst += result;
                size -= result;
@@ -736,7 +736,8 @@ do_bin_func:
                                src_buf = buf;
                                for (ptr = (uint8_t *)src_buf, i = 20; i > 0;
                                        i -= data_size, ptr += data_size)
-                                       memcpy(ptr, data, min(i, data_size));
+                                       memcpy(ptr, data,
+                                              min_t(size_t, i, data_size));
                        }
                }
                bin_func(dst_reg->digest, src_buf, 20);