Commit dbd1ac0b authored by Colin Ian King's avatar Colin Ian King Committed by Kleber Sacilotto de Souza

UBUNTU: SAUCE: opennsl: bcm-knet: remove redundant null checks on dev->name

BugLink: https://launchpad.net/bugs/1718388

dev->name is a char array and hence can never be null and so the
null checks on dev->name are redundant. Remove them.

Detected by CoverityScan CID#1456897, CID#145690 ("Array compared
against 0")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarJuerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
[kleber: adapted for new version path; adapted for context
(priv->dev->name instead of dev->name)]
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 221278d2
......@@ -4493,7 +4493,7 @@ bkn_proc_link_show(struct seq_file *m, void *v)
list_for_each(dlist, &sinfo->ndev_list) {
priv = (bkn_priv_t *)dlist;
dev = priv->dev;
if (dev && dev->name) {
if (dev) {
seq_printf(m, " %-14s %s\n", dev->name,
netif_carrier_ok(dev) ? "up" : "down");
}
......@@ -4560,7 +4560,7 @@ bkn_proc_link_write(struct file *file, const char *buf,
spin_lock_irqsave(&sinfo->lock, flags);
list_for_each(dlist, &sinfo->ndev_list) {
priv = (bkn_priv_t *)dlist;
if (priv->dev && priv->dev->name) {
if (priv->dev) {
if (strcmp(priv->dev->name, link_str) == 0) {
dev = priv->dev;
break;
......
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