]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/8021q/vlanproc.c
[VLAN] net/8021q/vlanproc.c: fix check-after-use
[karo-tx-linux.git] / net / 8021q / vlanproc.c
index d216a64421cd83eb19eeb021ae58b601ce3f63d0..bd08aa090763ad469e7e9c795f8057d8370e46f0 100644 (file)
@@ -69,7 +69,7 @@ static const char name_conf[]  = "config";
  *     Generic /proc/net/vlan/<file> file and inode operations
  */
 
-static struct seq_operations vlan_seq_ops = {
+static const struct seq_operations vlan_seq_ops = {
        .start = vlan_seq_start,
        .next = vlan_seq_next,
        .stop = vlan_seq_stop,
@@ -319,7 +319,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
        static const char fmt[] = "%30s %12lu\n";
        int i;
 
-       if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
+       if (!(vlandev->priv_flags & IFF_802_1Q_VLAN))
                return 0;
 
        seq_printf(seq, "%s  VID: %d     REORDER_HDR: %i  dev->priv_flags: %hx\n",
@@ -342,7 +342,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
        seq_printf(seq, "Device: %s", dev_info->real_dev->name);
        /* now show all PRIORITY mappings relating to this VLAN */
        seq_printf(seq,
-                      "\nINGRESS priority mappings: 0:%lu  1:%lu  2:%lu  3:%lu  4:%lu  5:%lu  6:%lu 7:%lu\n",
+                      "\nINGRESS priority mappings: 0:%u  1:%u  2:%u  3:%u  4:%u  5:%u  6:%u 7:%u\n",
                       dev_info->ingress_priority_map[0],
                       dev_info->ingress_priority_map[1],
                       dev_info->ingress_priority_map[2],
@@ -357,7 +357,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
                const struct vlan_priority_tci_mapping *mp
                        = dev_info->egress_priority_map[i];
                while (mp) {
-                       seq_printf(seq, "%lu:%hu ",
+                       seq_printf(seq, "%u:%hu ",
                                   mp->priority, ((mp->vlan_qos >> 13) & 0x7));
                        mp = mp->next;
                }