aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2009-04-23 11:53:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-27 06:02:47 -0400
commit011983048a120e520147361be1067dd82343038e (patch)
treef7cd95f11968b6cc1c3bd3677e3cfdf202f285ea
parent4e204c1000561ddb1a62a9df857cb0457dd868a7 (diff)
vxge: use max() instead of VXGE_HW_SET_LEVEL
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Acked-by: Ram Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxge/vxge-traffic.c55
-rw-r--r--drivers/net/vxge/vxge-traffic.h2
2 files changed, 23 insertions, 34 deletions
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 506625b180ac..cf4ebb55273d 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -505,7 +505,7 @@ enum vxge_hw_status vxge_hw_device_begin_irq(struct __vxge_hw_device *hldev,
505 ret = __vxge_hw_vpath_alarm_process( 505 ret = __vxge_hw_vpath_alarm_process(
506 &hldev->virtual_paths[i], skip_alarms); 506 &hldev->virtual_paths[i], skip_alarms);
507 507
508 error_level = VXGE_HW_SET_LEVEL(ret, error_level); 508 error_level = max(ret, error_level);
509 509
510 if (unlikely((ret == VXGE_HW_ERR_CRITICAL) || 510 if (unlikely((ret == VXGE_HW_ERR_CRITICAL) ||
511 (ret == VXGE_HW_ERR_SLOT_FREEZE))) 511 (ret == VXGE_HW_ERR_SLOT_FREEZE)))
@@ -1921,7 +1921,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
1921 struct vxge_hw_vpath_reg __iomem *vp_reg; 1921 struct vxge_hw_vpath_reg __iomem *vp_reg;
1922 1922
1923 if (vpath == NULL) { 1923 if (vpath == NULL) {
1924 alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN, 1924 alarm_event = max(VXGE_HW_EVENT_UNKNOWN,
1925 alarm_event); 1925 alarm_event);
1926 goto out2; 1926 goto out2;
1927 } 1927 }
@@ -1931,7 +1931,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
1931 alarm_status = readq(&vp_reg->vpath_general_int_status); 1931 alarm_status = readq(&vp_reg->vpath_general_int_status);
1932 1932
1933 if (alarm_status == VXGE_HW_ALL_FOXES) { 1933 if (alarm_status == VXGE_HW_ALL_FOXES) {
1934 alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_SLOT_FREEZE, 1934 alarm_event = max(VXGE_HW_EVENT_SLOT_FREEZE,
1935 alarm_event); 1935 alarm_event);
1936 goto out; 1936 goto out;
1937 } 1937 }
@@ -1945,7 +1945,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
1945 VXGE_HW_VPATH_GENERAL_INT_STATUS_XMAC_INT)) { 1945 VXGE_HW_VPATH_GENERAL_INT_STATUS_XMAC_INT)) {
1946 sw_stats->error_stats.unknown_alarms++; 1946 sw_stats->error_stats.unknown_alarms++;
1947 1947
1948 alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN, 1948 alarm_event = max(VXGE_HW_EVENT_UNKNOWN,
1949 alarm_event); 1949 alarm_event);
1950 goto out; 1950 goto out;
1951 } 1951 }
@@ -1975,8 +1975,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
1975 &vp_reg->asic_ntwk_vp_err_mask); 1975 &vp_reg->asic_ntwk_vp_err_mask);
1976 1976
1977 __vxge_hw_device_handle_link_down_ind(hldev); 1977 __vxge_hw_device_handle_link_down_ind(hldev);
1978 alarm_event = VXGE_HW_SET_LEVEL( 1978 alarm_event = max(VXGE_HW_EVENT_LINK_DOWN,
1979 VXGE_HW_EVENT_LINK_DOWN, alarm_event); 1979 alarm_event);
1980 } 1980 }
1981 1981
1982 if (((val64 & 1982 if (((val64 &
@@ -1996,15 +1996,15 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
1996 &vp_reg->asic_ntwk_vp_err_mask); 1996 &vp_reg->asic_ntwk_vp_err_mask);
1997 1997
1998 __vxge_hw_device_handle_link_up_ind(hldev); 1998 __vxge_hw_device_handle_link_up_ind(hldev);
1999 alarm_event = VXGE_HW_SET_LEVEL( 1999 alarm_event = max(VXGE_HW_EVENT_LINK_UP,
2000 VXGE_HW_EVENT_LINK_UP, alarm_event); 2000 alarm_event);
2001 } 2001 }
2002 2002
2003 writeq(VXGE_HW_INTR_MASK_ALL, 2003 writeq(VXGE_HW_INTR_MASK_ALL,
2004 &vp_reg->asic_ntwk_vp_err_reg); 2004 &vp_reg->asic_ntwk_vp_err_reg);
2005 2005
2006 alarm_event = VXGE_HW_SET_LEVEL( 2006 alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED,
2007 VXGE_HW_EVENT_ALARM_CLEARED, alarm_event); 2007 alarm_event);
2008 2008
2009 if (skip_alarms) 2009 if (skip_alarms)
2010 return VXGE_HW_OK; 2010 return VXGE_HW_OK;
@@ -2026,8 +2026,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2026 ~mask64) { 2026 ~mask64) {
2027 sw_stats->error_stats.ini_serr_det++; 2027 sw_stats->error_stats.ini_serr_det++;
2028 2028
2029 alarm_event = VXGE_HW_SET_LEVEL( 2029 alarm_event = max(VXGE_HW_EVENT_SERR,
2030 VXGE_HW_EVENT_SERR, alarm_event); 2030 alarm_event);
2031 } 2031 }
2032 2032
2033 if ((val64 & 2033 if ((val64 &
@@ -2035,8 +2035,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2035 ~mask64) { 2035 ~mask64) {
2036 sw_stats->error_stats.dblgen_fifo0_overflow++; 2036 sw_stats->error_stats.dblgen_fifo0_overflow++;
2037 2037
2038 alarm_event = VXGE_HW_SET_LEVEL( 2038 alarm_event = max(VXGE_HW_EVENT_FIFO_ERR,
2039 VXGE_HW_EVENT_FIFO_ERR, alarm_event); 2039 alarm_event);
2040 } 2040 }
2041 2041
2042 if ((val64 & 2042 if ((val64 &
@@ -2057,8 +2057,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2057 if (!skip_alarms) { 2057 if (!skip_alarms) {
2058 writeq(VXGE_HW_INTR_MASK_ALL, 2058 writeq(VXGE_HW_INTR_MASK_ALL,
2059 &vp_reg->general_errors_reg); 2059 &vp_reg->general_errors_reg);
2060 alarm_event = VXGE_HW_SET_LEVEL( 2060 alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED,
2061 VXGE_HW_EVENT_ALARM_CLEARED,
2062 alarm_event); 2061 alarm_event);
2063 } 2062 }
2064 } 2063 }
@@ -2074,8 +2073,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2074 ~mask64) { 2073 ~mask64) {
2075 sw_stats->error_stats.kdfcctl_fifo0_overwrite++; 2074 sw_stats->error_stats.kdfcctl_fifo0_overwrite++;
2076 2075
2077 alarm_event = VXGE_HW_SET_LEVEL( 2076 alarm_event = max(VXGE_HW_EVENT_FIFO_ERR,
2078 VXGE_HW_EVENT_FIFO_ERR,
2079 alarm_event); 2077 alarm_event);
2080 } 2078 }
2081 2079
@@ -2084,8 +2082,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2084 ~mask64) { 2082 ~mask64) {
2085 sw_stats->error_stats.kdfcctl_fifo0_poison++; 2083 sw_stats->error_stats.kdfcctl_fifo0_poison++;
2086 2084
2087 alarm_event = VXGE_HW_SET_LEVEL( 2085 alarm_event = max(VXGE_HW_EVENT_FIFO_ERR,
2088 VXGE_HW_EVENT_FIFO_ERR,
2089 alarm_event); 2086 alarm_event);
2090 } 2087 }
2091 2088
@@ -2094,16 +2091,14 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2094 ~mask64) { 2091 ~mask64) {
2095 sw_stats->error_stats.kdfcctl_fifo0_dma_error++; 2092 sw_stats->error_stats.kdfcctl_fifo0_dma_error++;
2096 2093
2097 alarm_event = VXGE_HW_SET_LEVEL( 2094 alarm_event = max(VXGE_HW_EVENT_FIFO_ERR,
2098 VXGE_HW_EVENT_FIFO_ERR,
2099 alarm_event); 2095 alarm_event);
2100 } 2096 }
2101 2097
2102 if (!skip_alarms) { 2098 if (!skip_alarms) {
2103 writeq(VXGE_HW_INTR_MASK_ALL, 2099 writeq(VXGE_HW_INTR_MASK_ALL,
2104 &vp_reg->kdfcctl_errors_reg); 2100 &vp_reg->kdfcctl_errors_reg);
2105 alarm_event = VXGE_HW_SET_LEVEL( 2101 alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED,
2106 VXGE_HW_EVENT_ALARM_CLEARED,
2107 alarm_event); 2102 alarm_event);
2108 } 2103 }
2109 } 2104 }
@@ -2127,8 +2122,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2127 ~mask64) { 2122 ~mask64) {
2128 sw_stats->error_stats.prc_rxdcm_sc_err++; 2123 sw_stats->error_stats.prc_rxdcm_sc_err++;
2129 2124
2130 alarm_event = VXGE_HW_SET_LEVEL( 2125 alarm_event = max(VXGE_HW_EVENT_VPATH_ERR,
2131 VXGE_HW_EVENT_VPATH_ERR,
2132 alarm_event); 2126 alarm_event);
2133 } 2127 }
2134 2128
@@ -2136,8 +2130,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2136 & ~mask64) { 2130 & ~mask64) {
2137 sw_stats->error_stats.prc_rxdcm_sc_abort++; 2131 sw_stats->error_stats.prc_rxdcm_sc_abort++;
2138 2132
2139 alarm_event = VXGE_HW_SET_LEVEL( 2133 alarm_event = max(VXGE_HW_EVENT_VPATH_ERR,
2140 VXGE_HW_EVENT_VPATH_ERR,
2141 alarm_event); 2134 alarm_event);
2142 } 2135 }
2143 2136
@@ -2145,16 +2138,14 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process(
2145 & ~mask64) { 2138 & ~mask64) {
2146 sw_stats->error_stats.prc_quanta_size_err++; 2139 sw_stats->error_stats.prc_quanta_size_err++;
2147 2140
2148 alarm_event = VXGE_HW_SET_LEVEL( 2141 alarm_event = max(VXGE_HW_EVENT_VPATH_ERR,
2149 VXGE_HW_EVENT_VPATH_ERR,
2150 alarm_event); 2142 alarm_event);
2151 } 2143 }
2152 2144
2153 if (!skip_alarms) { 2145 if (!skip_alarms) {
2154 writeq(VXGE_HW_INTR_MASK_ALL, 2146 writeq(VXGE_HW_INTR_MASK_ALL,
2155 &vp_reg->prc_alarm_reg); 2147 &vp_reg->prc_alarm_reg);
2156 alarm_event = VXGE_HW_SET_LEVEL( 2148 alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED,
2157 VXGE_HW_EVENT_ALARM_CLEARED,
2158 alarm_event); 2149 alarm_event);
2159 } 2150 }
2160 } 2151 }
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
index 7567a1140d07..d03f3d3805c9 100644
--- a/drivers/net/vxge/vxge-traffic.h
+++ b/drivers/net/vxge/vxge-traffic.h
@@ -110,8 +110,6 @@ enum vxge_hw_event {
110 VXGE_HW_EVENT_SLOT_FREEZE = VXGE_HW_EVENT_BASE + 14, 110 VXGE_HW_EVENT_SLOT_FREEZE = VXGE_HW_EVENT_BASE + 14,
111}; 111};
112 112
113#define VXGE_HW_SET_LEVEL(a, b) (((a) > (b)) ? (a) : (b))
114
115/* 113/*
116 * struct vxge_hw_mempool_dma - Represents DMA objects passed to the 114 * struct vxge_hw_mempool_dma - Represents DMA objects passed to the
117 caller. 115 caller.