* netlink.c (decode_nlmsghdr_with_payload): Use MIN.
* netlink_packet_diag.c (print_packet_diag_mclist): Likewise.
* nlattr.c (decode_nlattr_with_data): Likewise.
* rtnl_route.c (decode_rta_multipath): Likewise.
const kernel_ulong_t addr,
const kernel_ulong_t len)
{
- const unsigned int nlmsg_len =
- nlmsghdr->nlmsg_len > len ? len : nlmsghdr->nlmsg_len;
+ const unsigned int nlmsg_len = MIN(nlmsghdr->nlmsg_len, len);
if (nlmsg_len > NLMSG_HDRLEN)
tprints("{");
const size_t elem_size, void *const opaque_data)
{
struct packet_diag_mclist *dml = elem_buf;
- uint16_t alen = dml->pdmc_alen > sizeof(dml->pdmc_addr) ?
- sizeof(dml->pdmc_addr) : dml->pdmc_alen;
+ uint16_t alen = MIN(dml->pdmc_alen, sizeof(dml->pdmc_addr));
PRINT_FIELD_IFINDEX("{", *dml, pdmc_index);
PRINT_FIELD_U(", ", *dml, pdmc_count);
const unsigned int size,
const void *const opaque_data)
{
- const unsigned int nla_len = nla->nla_len > len ? len : nla->nla_len;
+ const unsigned int nla_len = MIN(nla->nla_len, len);
if (nla_len > NLA_HDRLEN)
tprints("{");
PRINT_FIELD_IFINDEX(", ", nh, rtnh_ifindex);
tprints("}");
- const unsigned short rtnh_len =
- len < nh.rtnh_len ? len : nh.rtnh_len;
+ const unsigned short rtnh_len = MIN(len, nh.rtnh_len);
const size_t offset = RTNH_ALIGN(sizeof(nh));
if (rtnh_len > offset) {
tprints(", ");