提交 ffb8cc92 编写于 作者: S Silvan Jegen 提交者: Greg Kroah-Hartman

Staging: rtl8192e: Replace min macro with min_t

Instead of an explicit cast the min_t macro should be used.
Signed-off-by: NSilvan Jegen <s.jegen@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 56f14114
...@@ -609,7 +609,7 @@ static int r8192_wx_set_nick(struct net_device *dev, ...@@ -609,7 +609,7 @@ static int r8192_wx_set_nick(struct net_device *dev,
if (wrqu->data.length > IW_ESSID_MAX_SIZE) if (wrqu->data.length > IW_ESSID_MAX_SIZE)
return -E2BIG; return -E2BIG;
down(&priv->wx_sem); down(&priv->wx_sem);
wrqu->data.length = min((size_t) wrqu->data.length, sizeof(priv->nick)); wrqu->data.length = min_t(size_t, wrqu->data.length, sizeof(priv->nick));
memset(priv->nick, 0, sizeof(priv->nick)); memset(priv->nick, 0, sizeof(priv->nick));
memcpy(priv->nick, extra, wrqu->data.length); memcpy(priv->nick, extra, wrqu->data.length);
up(&priv->wx_sem); up(&priv->wx_sem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册