infiniband: cleanup a min_t() cast in set_node_desc()
Subsystems (2)
PATCH 1/1 infiniband: cleanup a min_t() cast in set_node_desc()
This is just a cleanup.
The "count" variable here is type size_t so casting it to int in min_t() truncates the higher values. Of course, this is sysfs so count is capped at a PAGE_SIZE but static checkers don't know that.
Signed-off-by Dan Carpenter <[email protected]>
drivers/infiniband/core/sysfs.c +1 -1
@@ -641,7 +641,7 @@ static ssize_t set_node_desc(struct device *device,if (!dev->modify_device)return -EIO ; -memcpy (desc.node_desc, buf,min_t (int, count,64 )); +memcpy (desc.node_desc, buf,min_t (size_t, count,64 )); ret =ib_modify_device (dev,IB_DEVICE_MODIFY_NODE_DESC , &desc);if (ret)return ret;