net: aquantia: Eliminate AQ_DIMOF, replace with ARRAY_SIZE
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3b039b42e4
commit
08b5cf08bc
|
@ -992,7 +992,7 @@ void aq_nic_free_hot_resources(struct aq_nic_s *self)
|
||||||
if (!self)
|
if (!self)
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
|
|
||||||
for (i = AQ_DIMOF(self->aq_vec); i--;) {
|
for (i = ARRAY_SIZE(self->aq_vec); i--;) {
|
||||||
if (self->aq_vec[i]) {
|
if (self->aq_vec[i]) {
|
||||||
aq_vec_free(self->aq_vec[i]);
|
aq_vec_free(self->aq_vec[i]);
|
||||||
self->aq_vec[i] = NULL;
|
self->aq_vec[i] = NULL;
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
|
|
||||||
#include "aq_common.h"
|
#include "aq_common.h"
|
||||||
|
|
||||||
#define AQ_DIMOF(_ARY_) ARRAY_SIZE(_ARY_)
|
|
||||||
|
|
||||||
struct aq_obj_s {
|
struct aq_obj_s {
|
||||||
atomic_t flags;
|
atomic_t flags;
|
||||||
};
|
};
|
||||||
|
|
|
@ -193,7 +193,7 @@ static int hw_atl_a0_hw_rss_set(struct aq_hw_s *self,
|
||||||
((i * 3U) & 0xFU));
|
((i * 3U) & 0xFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = AQ_DIMOF(bitary); i--;) {
|
for (i = ARRAY_SIZE(bitary); i--;) {
|
||||||
rpf_rss_redir_tbl_wr_data_set(self, bitary[i]);
|
rpf_rss_redir_tbl_wr_data_set(self, bitary[i]);
|
||||||
rpf_rss_redir_tbl_addr_set(self, i);
|
rpf_rss_redir_tbl_addr_set(self, i);
|
||||||
rpf_rss_redir_wr_en_set(self, 1U);
|
rpf_rss_redir_wr_en_set(self, 1U);
|
||||||
|
|
|
@ -194,7 +194,7 @@ static int hw_atl_b0_hw_rss_set(struct aq_hw_s *self,
|
||||||
((i * 3U) & 0xFU));
|
((i * 3U) & 0xFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = AQ_DIMOF(bitary); i--;) {
|
for (i = ARRAY_SIZE(bitary); i--;) {
|
||||||
rpf_rss_redir_tbl_wr_data_set(self, bitary[i]);
|
rpf_rss_redir_tbl_wr_data_set(self, bitary[i]);
|
||||||
rpf_rss_redir_tbl_addr_set(self, i);
|
rpf_rss_redir_tbl_addr_set(self, i);
|
||||||
rpf_rss_redir_wr_en_set(self, 1U);
|
rpf_rss_redir_wr_en_set(self, 1U);
|
||||||
|
|
|
@ -396,7 +396,7 @@ int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self,
|
||||||
aq_hw_read_reg(self, 0x00000374U) +
|
aq_hw_read_reg(self, 0x00000374U) +
|
||||||
(40U * 4U),
|
(40U * 4U),
|
||||||
mac_addr,
|
mac_addr,
|
||||||
AQ_DIMOF(mac_addr));
|
ARRAY_SIZE(mac_addr));
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
mac_addr[0] = 0U;
|
mac_addr[0] = 0U;
|
||||||
mac_addr[1] = 0U;
|
mac_addr[1] = 0U;
|
||||||
|
|
Loading…
Reference in New Issue