]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Merge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into...
authorChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 21:02:30 +0000 (13:02 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 21:02:30 +0000 (13:02 -0800)
1  2 
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/usb/host/xhci.c

index d60fbf0b83d0526a64e87ba27baf5e1306cf1d51,c354d7e17394926eed00b9567d50b95158dc9e7c..e2d015de7269967c68b6bb2f648f51cccabfe07b
@@@ -9861,77 -10484,54 +10543,84 @@@ static int i40e_setup_pf_filter_control
  static void i40e_print_features(struct i40e_pf *pf)
  {
        struct i40e_hw *hw = &pf->hw;
-       char *buf, *string;
+       char *buf;
+       int i;
  
-       string = kzalloc(INFO_STRING_LEN, GFP_KERNEL);
-       if (!string) {
-               dev_err(&pf->pdev->dev, "Features string allocation failed\n");
+       buf = kmalloc(INFO_STRING_LEN, GFP_KERNEL);
+       if (!buf)
                return;
-       }
-       buf = string;
  
-       buf += sprintf(string, "Features: PF-id[%d] ", hw->pf_id);
+       i = snprintf(buf, INFO_STRING_LEN, "Features: PF-id[%d]", hw->pf_id);
  #ifdef CONFIG_PCI_IOV
-       buf += sprintf(buf, "VFs: %d ", pf->num_req_vfs);
+       i += snprintf(&buf[i], REMAIN(i), " VFs: %d", pf->num_req_vfs);
  #endif
-       buf += sprintf(buf, "VSIs: %d QP: %d RX: %s ",
-                      pf->hw.func_caps.num_vsis,
-                      pf->vsi[pf->lan_vsi]->num_queue_pairs,
-                      pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" : "1BUF");
+       i += snprintf(&buf[i], REMAIN(i), " VSIs: %d QP: %d RX: %s",
+                     pf->hw.func_caps.num_vsis,
+                     pf->vsi[pf->lan_vsi]->num_queue_pairs,
+                     pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" : "1BUF");
  
        if (pf->flags & I40E_FLAG_RSS_ENABLED)
-               buf += sprintf(buf, "RSS ");
+               i += snprintf(&buf[i], REMAIN(i), " RSS");
        if (pf->flags & I40E_FLAG_FD_ATR_ENABLED)
-               buf += sprintf(buf, "FD_ATR ");
+               i += snprintf(&buf[i], REMAIN(i), " FD_ATR");
        if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
-               buf += sprintf(buf, "FD_SB ");
-               buf += sprintf(buf, "NTUPLE ");
+               i += snprintf(&buf[i], REMAIN(i), " FD_SB");
+               i += snprintf(&buf[i], REMAIN(i), " NTUPLE");
        }
        if (pf->flags & I40E_FLAG_DCB_CAPABLE)
-               buf += sprintf(buf, "DCB ");
+               i += snprintf(&buf[i], REMAIN(i), " DCB");
+ #if IS_ENABLED(CONFIG_VXLAN)
+       i += snprintf(&buf[i], REMAIN(i), " VxLAN");
+ #endif
+ #if IS_ENABLED(CONFIG_GENEVE)
+       i += snprintf(&buf[i], REMAIN(i), " Geneve");
+ #endif
        if (pf->flags & I40E_FLAG_PTP)
-               buf += sprintf(buf, "PTP ");
+               i += snprintf(&buf[i], REMAIN(i), " PTP");
  #ifdef I40E_FCOE
        if (pf->flags & I40E_FLAG_FCOE_ENABLED)
-               buf += sprintf(buf, "FCOE ");
+               i += snprintf(&buf[i], REMAIN(i), " FCOE");
  #endif
+       if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
+               i += snprintf(&buf[i], REMAIN(i), " VEB");
+       else
+               i += snprintf(&buf[i], REMAIN(i), " VEPA");
  
-       BUG_ON(buf > (string + INFO_STRING_LEN));
-       dev_info(&pf->pdev->dev, "%s\n", string);
-       kfree(string);
+       dev_info(&pf->pdev->dev, "%s\n", buf);
+       kfree(buf);
+       WARN_ON(i > INFO_STRING_LEN);
  }
  
 +/**
 + * i40e_get_platform_mac_addr - get mac address from Open Firmware
 + * or IDPROM if supported by the platform
 + *
 + * @pdev: PCI device information struct
 + * @mac_addr: the MAC address to be returned
 + *
 + * Look up the MAC address in Open Firmware  on systems that support it,
 + * and use IDPROM on SPARC if no OF address is found.
 + *
 + * Returns 0 on success, negative on failure
 + **/
 +static int i40e_get_platform_mac_addr(struct pci_dev *pdev, u8 *mac_addr)
 +{
 +      struct device_node *dp = pci_device_to_OF_node(pdev);
 +      const unsigned char *addr;
 +
 +      addr = of_get_mac_address(dp);
 +      if (addr) {
 +              ether_addr_copy(mac_addr, addr);
 +              return 0;
 +      }
 +#ifdef CONFIG_SPARC
 +      ether_addr_copy(mac_addr, idprom->id_ethaddr);
 +      return 0;
 +#else
 +      return -EINVAL;
 +#endif /* CONFIG_SPARC */
 +}
 +
  /**
   * i40e_probe - Device initialization routine
   * @pdev: PCI device information struct
Simple merge