diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-05-08 18:02:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-09 16:13:37 -0400 |
commit | 23b6cc425d718fce2501d5f60e368cfa44ef7d86 (patch) | |
tree | 5d184b032bdc1ef79d5419c4d3de8ce6eba08013 /drivers/net/netxen/netxen_nic_hw.c | |
parent | b0b3a75b36afe3b1ed2c12b8817b6326db8ed003 (diff) |
netxen: trivial register access cleanup
Remove unnecessary length parameter since it's always 4 bytes.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 86c9e78ec39e..42ffb825ebf1 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -914,17 +914,15 @@ netxen_nic_pci_change_crbwindow_128M(struct netxen_adapter *adapter, u32 wndw) | |||
914 | * In: 'off' is offset from base in 128M pci map | 914 | * In: 'off' is offset from base in 128M pci map |
915 | */ | 915 | */ |
916 | static int | 916 | static int |
917 | netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, | 917 | netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong *off) |
918 | ulong *off, int len) | ||
919 | { | 918 | { |
920 | unsigned long end = *off + len; | ||
921 | crb_128M_2M_sub_block_map_t *m; | 919 | crb_128M_2M_sub_block_map_t *m; |
922 | 920 | ||
923 | 921 | ||
924 | if (*off >= NETXEN_CRB_MAX) | 922 | if (*off >= NETXEN_CRB_MAX) |
925 | return -1; | 923 | return -1; |
926 | 924 | ||
927 | if (*off >= NETXEN_PCI_CAMQM && (end <= NETXEN_PCI_CAMQM_2M_END)) { | 925 | if (*off >= NETXEN_PCI_CAMQM && (*off < NETXEN_PCI_CAMQM_2M_END)) { |
928 | *off = (*off - NETXEN_PCI_CAMQM) + NETXEN_PCI_CAMQM_2M_BASE + | 926 | *off = (*off - NETXEN_PCI_CAMQM) + NETXEN_PCI_CAMQM_2M_BASE + |
929 | (ulong)adapter->ahw.pci_base0; | 927 | (ulong)adapter->ahw.pci_base0; |
930 | return 0; | 928 | return 0; |
@@ -934,14 +932,13 @@ netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, | |||
934 | return -1; | 932 | return -1; |
935 | 933 | ||
936 | *off -= NETXEN_PCI_CRBSPACE; | 934 | *off -= NETXEN_PCI_CRBSPACE; |
937 | end = *off + len; | ||
938 | 935 | ||
939 | /* | 936 | /* |
940 | * Try direct map | 937 | * Try direct map |
941 | */ | 938 | */ |
942 | m = &crb_128M_2M_map[CRB_BLK(*off)].sub_block[CRB_SUBBLK(*off)]; | 939 | m = &crb_128M_2M_map[CRB_BLK(*off)].sub_block[CRB_SUBBLK(*off)]; |
943 | 940 | ||
944 | if (m->valid && (m->start_128M <= *off) && (m->end_128M >= end)) { | 941 | if (m->valid && (m->start_128M <= *off) && (m->end_128M > *off)) { |
945 | *off = *off + m->start_2M - m->start_128M + | 942 | *off = *off + m->start_2M - m->start_128M + |
946 | (ulong)adapter->ahw.pci_base0; | 943 | (ulong)adapter->ahw.pci_base0; |
947 | return 0; | 944 | return 0; |
@@ -1036,7 +1033,7 @@ netxen_nic_hw_write_wx_2M(struct netxen_adapter *adapter, ulong off, u32 data) | |||
1036 | unsigned long flags = 0; | 1033 | unsigned long flags = 0; |
1037 | int rv; | 1034 | int rv; |
1038 | 1035 | ||
1039 | rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off, 4); | 1036 | rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off); |
1040 | 1037 | ||
1041 | if (rv == -1) { | 1038 | if (rv == -1) { |
1042 | printk(KERN_ERR "%s: invalid offset: 0x%016lx\n", | 1039 | printk(KERN_ERR "%s: invalid offset: 0x%016lx\n", |
@@ -1066,7 +1063,7 @@ netxen_nic_hw_read_wx_2M(struct netxen_adapter *adapter, ulong off) | |||
1066 | int rv; | 1063 | int rv; |
1067 | u32 data; | 1064 | u32 data; |
1068 | 1065 | ||
1069 | rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off, 4); | 1066 | rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off); |
1070 | 1067 | ||
1071 | if (rv == -1) { | 1068 | if (rv == -1) { |
1072 | printk(KERN_ERR "%s: invalid offset: 0x%016lx\n", | 1069 | printk(KERN_ERR "%s: invalid offset: 0x%016lx\n", |