diff options
author | Richard Yao <[email protected]> | 2023-01-10 16:41:26 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2023-01-12 16:00:23 -0800 |
commit | 3b2f9c1ec81a0c7059a81f5b4ae1e8f6296c090b (patch) | |
tree | fef70ffe28487a1bb82b32a267256c2a67ea895f | |
parent | e6328fda2e5cb9644b54b797afb139a3b76dfd64 (diff) |
Cleanup: Use MIN() macro
The Linux 5.16.14 kernel's coccicheck caught this. The semantic
patch that caught it was:
./scripts/coccinelle/misc/minmax.cocci
There was a third opportunity to use `MIN()`, but that was in
`FSE_minTableLog()` in `module/zstd/lib/compress/fse_compress.c`.
Upstream zstd has yet to make this change and I did not want to change
header includes just for MIN, or do a one off, so I left it alone.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14372
-rw-r--r-- | module/icp/algs/modes/ccm.c | 2 | ||||
-rw-r--r-- | module/zfs/dmu_send.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/module/icp/algs/modes/ccm.c b/module/icp/algs/modes/ccm.c index 4a8bb9bbc..1371676d6 100644 --- a/module/icp/algs/modes/ccm.c +++ b/module/icp/algs/modes/ccm.c @@ -657,7 +657,7 @@ ccm_format_initial_blocks(uchar_t *nonce, ulong_t nonceSize, memset(&(b0[1+nonceSize]), 0, q); payloadSize = aes_ctx->ccm_data_len; - limit = 8 < q ? 8 : q; + limit = MIN(8, q); for (i = 0, j = 0, k = 15; i < limit; i++, j += 8, k--) { b0[k] = (uint8_t)((payloadSize >> j) & 0xFF); diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index bcbc2ba60..7f8de23f0 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -1842,8 +1842,7 @@ send_reader_thread(void *arg) continue; } uint64_t file_max = - (dn->dn_maxblkid < range->end_blkid ? - dn->dn_maxblkid : range->end_blkid); + MIN(dn->dn_maxblkid, range->end_blkid); /* * The object exists, so we need to try to find the * blkptr for each block in the range we're processing. |