Commit 3f78f611 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

Staging: most: replace min() by min_t()

This patch fixes wrong casting.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6852ac9a
......@@ -973,7 +973,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
char *mdev_devnod;
char devnod_buf[STRING_SIZE];
int ret;
unsigned int max_len = min((int)len + 1, STRING_SIZE);
size_t max_len = min_t(size_t, len + 1, STRING_SIZE);
strlcpy(buffer, buf, max_len);
strlcpy(aim_obj->add_link, buf, max_len);
......@@ -1036,7 +1036,7 @@ static ssize_t store_remove_link(struct most_aim_obj *aim_obj,
char *mdev;
char *mdev_ch;
int ret;
unsigned int max_len = min((int)len + 1, STRING_SIZE);
size_t max_len = min_t(size_t, len + 1, STRING_SIZE);
strlcpy(buffer, buf, max_len);
strlcpy(aim_obj->remove_link, buf, max_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment