Commit 95f050bf authored by David S. Miller's avatar David S. Miller

net: Use bool for return value of dev_valid_name().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 66431a7d
......@@ -2122,7 +2122,7 @@ extern int netdev_rx_handler_register(struct net_device *dev,
void *rx_handler_data);
extern void netdev_rx_handler_unregister(struct net_device *dev);
extern int dev_valid_name(const char *name);
extern bool dev_valid_name(const char *name);
extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
extern int dev_ethtool(struct net *net, struct ifreq *);
extern unsigned dev_get_flags(const struct net_device *);
......
......@@ -848,21 +848,21 @@ EXPORT_SYMBOL(dev_get_by_flags_rcu);
* to allow sysfs to work. We also disallow any kind of
* whitespace.
*/
int dev_valid_name(const char *name)
bool dev_valid_name(const char *name)
{
if (*name == '\0')
return 0;
return false;
if (strlen(name) >= IFNAMSIZ)
return 0;
return false;
if (!strcmp(name, ".") || !strcmp(name, ".."))
return 0;
return false;
while (*name) {
if (*name == '/' || isspace(*name))
return 0;
return false;
name++;
}
return 1;
return true;
}
EXPORT_SYMBOL(dev_valid_name);
......
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