Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlcnic: remove dead code

This driver has several pieces of dead code (found by running
make namespacecheck). This patch removes them.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

stephen hemminger and committed by
David S. Miller
debf279a ee624599

-176
-7
drivers/net/qlcnic/qlcnic.h
··· 1323 1323 void qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring); 1324 1324 1325 1325 /* Management functions */ 1326 - int qlcnic_set_mac_address(struct qlcnic_adapter *, u8*); 1327 1326 int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*); 1328 1327 int qlcnic_get_nic_info(struct qlcnic_adapter *, struct qlcnic_info *, u8); 1329 1328 int qlcnic_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *); 1330 1329 int qlcnic_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info*); 1331 - int qlcnic_reset_partition(struct qlcnic_adapter *, u8); 1332 1330 1333 1331 /* eSwitch management functions */ 1334 - int qlcnic_get_eswitch_capabilities(struct qlcnic_adapter *, u8, 1335 - struct qlcnic_eswitch *); 1336 - int qlcnic_get_eswitch_status(struct qlcnic_adapter *, u8, 1337 - struct qlcnic_eswitch *); 1338 - int qlcnic_toggle_eswitch(struct qlcnic_adapter *, u8, u8); 1339 1332 int qlcnic_config_switch_port(struct qlcnic_adapter *, 1340 1333 struct qlcnic_esw_func_cfg *); 1341 1334 int qlcnic_get_eswitch_port_config(struct qlcnic_adapter *,
-169
drivers/net/qlcnic/qlcnic_ctx.c
··· 556 556 } 557 557 } 558 558 559 - /* Set MAC address of a NIC partition */ 560 - int qlcnic_set_mac_address(struct qlcnic_adapter *adapter, u8* mac) 561 - { 562 - int err = 0; 563 - u32 arg1, arg2, arg3; 564 - 565 - arg1 = adapter->ahw.pci_func | BIT_9; 566 - arg2 = mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24); 567 - arg3 = mac[4] | (mac[5] << 16); 568 - 569 - err = qlcnic_issue_cmd(adapter, 570 - adapter->ahw.pci_func, 571 - adapter->fw_hal_version, 572 - arg1, 573 - arg2, 574 - arg3, 575 - QLCNIC_CDRP_CMD_MAC_ADDRESS); 576 - 577 - if (err != QLCNIC_RCODE_SUCCESS) { 578 - dev_err(&adapter->pdev->dev, 579 - "Failed to set mac address%d\n", err); 580 - err = -EIO; 581 - } 582 - 583 - return err; 584 - } 585 559 586 560 /* Get MAC address of a NIC partition */ 587 561 int qlcnic_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac) ··· 735 761 736 762 pci_free_consistent(adapter->pdev, pci_size, pci_info_addr, 737 763 pci_info_dma_t); 738 - return err; 739 - } 740 - 741 - /* Reset a NIC partition */ 742 - 743 - int qlcnic_reset_partition(struct qlcnic_adapter *adapter, u8 func_no) 744 - { 745 - int err = -EIO; 746 - 747 - if (adapter->op_mode != QLCNIC_MGMT_FUNC) 748 - return err; 749 - 750 - err = qlcnic_issue_cmd(adapter, 751 - adapter->ahw.pci_func, 752 - adapter->fw_hal_version, 753 - func_no, 754 - 0, 755 - 0, 756 - QLCNIC_CDRP_CMD_RESET_NPAR); 757 - 758 - if (err != QLCNIC_RCODE_SUCCESS) { 759 - dev_err(&adapter->pdev->dev, 760 - "Failed to issue reset partition%d\n", err); 761 - err = -EIO; 762 - } 763 - 764 - return err; 765 - } 766 - 767 - /* Get eSwitch Capabilities */ 768 - int qlcnic_get_eswitch_capabilities(struct qlcnic_adapter *adapter, u8 port, 769 - struct qlcnic_eswitch *eswitch) 770 - { 771 - int err = -EIO; 772 - u32 arg1, arg2; 773 - 774 - if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) 775 - return err; 776 - 777 - err = qlcnic_issue_cmd(adapter, 778 - adapter->ahw.pci_func, 779 - adapter->fw_hal_version, 780 - port, 781 - 0, 782 - 0, 783 - QLCNIC_CDRP_CMD_GET_ESWITCH_CAPABILITY); 784 - 785 - if (err == QLCNIC_RCODE_SUCCESS) { 786 - arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET); 787 - arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET); 788 - 789 - eswitch->port = arg1 & 0xf; 790 - eswitch->max_ucast_filters = LSW(arg2); 791 - eswitch->max_active_vlans = MSW(arg2) & 0xfff; 792 - if (arg1 & BIT_6) 793 - eswitch->flags |= QLCNIC_SWITCH_VLAN_FILTERING; 794 - if (arg1 & BIT_7) 795 - eswitch->flags |= QLCNIC_SWITCH_PROMISC_MODE; 796 - if (arg1 & BIT_8) 797 - eswitch->flags |= QLCNIC_SWITCH_PORT_MIRRORING; 798 - } else { 799 - dev_err(&adapter->pdev->dev, 800 - "Failed to get eswitch capabilities%d\n", err); 801 - } 802 - 803 - return err; 804 - } 805 - 806 - /* Get current status of eswitch */ 807 - int qlcnic_get_eswitch_status(struct qlcnic_adapter *adapter, u8 port, 808 - struct qlcnic_eswitch *eswitch) 809 - { 810 - int err = -EIO; 811 - u32 arg1, arg2; 812 - 813 - if (adapter->op_mode != QLCNIC_MGMT_FUNC) 814 - return err; 815 - 816 - err = qlcnic_issue_cmd(adapter, 817 - adapter->ahw.pci_func, 818 - adapter->fw_hal_version, 819 - port, 820 - 0, 821 - 0, 822 - QLCNIC_CDRP_CMD_GET_ESWITCH_STATUS); 823 - 824 - if (err == QLCNIC_RCODE_SUCCESS) { 825 - arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET); 826 - arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET); 827 - 828 - eswitch->port = arg1 & 0xf; 829 - eswitch->active_vports = LSB(arg2); 830 - eswitch->active_ucast_filters = MSB(arg2); 831 - eswitch->active_vlans = LSB(MSW(arg2)); 832 - if (arg1 & BIT_6) 833 - eswitch->flags |= QLCNIC_SWITCH_VLAN_FILTERING; 834 - if (arg1 & BIT_8) 835 - eswitch->flags |= QLCNIC_SWITCH_PORT_MIRRORING; 836 - 837 - } else { 838 - dev_err(&adapter->pdev->dev, 839 - "Failed to get eswitch status%d\n", err); 840 - } 841 - 842 - return err; 843 - } 844 - 845 - /* Enable/Disable eSwitch */ 846 - int qlcnic_toggle_eswitch(struct qlcnic_adapter *adapter, u8 id, u8 enable) 847 - { 848 - int err = -EIO; 849 - u32 arg1, arg2; 850 - struct qlcnic_eswitch *eswitch; 851 - 852 - if (adapter->op_mode != QLCNIC_MGMT_FUNC) 853 - return err; 854 - 855 - eswitch = &adapter->eswitch[id]; 856 - if (!eswitch) 857 - return err; 858 - 859 - arg1 = eswitch->port | (enable ? BIT_4 : 0); 860 - arg2 = eswitch->active_vports | (eswitch->max_ucast_filters << 8) | 861 - (eswitch->max_active_vlans << 16); 862 - err = qlcnic_issue_cmd(adapter, 863 - adapter->ahw.pci_func, 864 - adapter->fw_hal_version, 865 - arg1, 866 - arg2, 867 - 0, 868 - QLCNIC_CDRP_CMD_TOGGLE_ESWITCH); 869 - 870 - if (err != QLCNIC_RCODE_SUCCESS) { 871 - dev_err(&adapter->pdev->dev, 872 - "Failed to enable eswitch%d\n", eswitch->port); 873 - eswitch->flags &= ~QLCNIC_SWITCH_ENABLE; 874 - err = -EIO; 875 - } else { 876 - eswitch->flags |= QLCNIC_SWITCH_ENABLE; 877 - dev_info(&adapter->pdev->dev, 878 - "Enabled eSwitch for port %d\n", eswitch->port); 879 - } 880 - 881 764 return err; 882 765 } 883 766