From: Muna Sinada <msinada@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Muna Sinada <msinada@codeaurora.org>
Subject: [PATCH 3/4] ath11k: cast reo_desc directly to struct hal_tlv_hdr
Date: Thu, 20 Jun 2019 12:15:28 -0700 [thread overview]
Message-ID: <1561058129-25625-3-git-send-email-msinada@codeaurora.org> (raw)
In-Reply-To: <1561058129-25625-1-git-send-email-msinada@codeaurora.org>
To avoid opaque pointers, reo_desc directly casted to 'struct hal_tlv_hdr *'
in ath11k_hal_reo_cmd_send(). Due to this, removed unnecessary typecasting
in functions that received reo_desc as an argument.
Signed-off-by: Muna Sinada <msinada@codeaurora.org>
---
drivers/net/wireless/ath/ath11k/hal_rx.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c
index 622f4dfa5535..376b519595c1 100644
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
@@ -20,10 +20,9 @@ static void ath11k_hal_reo_set_desc_hdr(struct hal_desc_header *hdr,
hdr->info0 |= FIELD_PREP(HAL_DESC_HDR_INFO0_DBG_RESERVED, magic);
}
-static int ath11k_hal_reo_cmd_queue_stats(u32 *reo_desc,
+static int ath11k_hal_reo_cmd_queue_stats(struct hal_tlv_hdr *tlv,
struct ath11k_hal_reo_cmd *cmd)
{
- struct hal_tlv_hdr *tlv = (struct hal_tlv_hdr *)reo_desc;
struct hal_reo_get_queue_stats *desc;
tlv->tl = FIELD_PREP(HAL_TLV_HDR_TAG, HAL_REO_GET_QUEUE_STATS) |
@@ -46,10 +45,9 @@ static int ath11k_hal_reo_cmd_queue_stats(u32 *reo_desc,
return FIELD_GET(HAL_REO_CMD_HDR_INFO0_CMD_NUMBER, desc->cmd.info0);
}
-static int ath11k_hal_reo_cmd_flush_cache(struct ath11k_hal *hal, u32 *reo_desc,
+static int ath11k_hal_reo_cmd_flush_cache(struct ath11k_hal *hal, struct hal_tlv_hdr *tlv,
struct ath11k_hal_reo_cmd *cmd)
{
- struct hal_tlv_hdr *tlv = (struct hal_tlv_hdr *)reo_desc;
struct hal_reo_flush_cache *desc;
u8 avail_slot = ffz(hal->avail_blk_resource);
@@ -94,10 +92,9 @@ static int ath11k_hal_reo_cmd_flush_cache(struct ath11k_hal *hal, u32 *reo_desc,
return FIELD_GET(HAL_REO_CMD_HDR_INFO0_CMD_NUMBER, desc->cmd.info0);
}
-static int ath11k_hal_reo_cmd_update_rx_queue(u32 *reo_desc,
+static int ath11k_hal_reo_cmd_update_rx_queue(struct hal_tlv_hdr *tlv,
struct ath11k_hal_reo_cmd *cmd)
{
- struct hal_tlv_hdr *tlv = (struct hal_tlv_hdr *)reo_desc;
struct hal_reo_update_rx_queue *desc;
tlv->tl = FIELD_PREP(HAL_TLV_HDR_TAG, HAL_REO_UPDATE_RX_REO_QUEUE) |
@@ -225,13 +222,13 @@ int ath11k_hal_reo_cmd_send(struct ath11k_base *ab, struct hal_srng *srng,
enum hal_reo_cmd_type type,
struct ath11k_hal_reo_cmd *cmd)
{
- u32 *reo_desc;
+ struct hal_tlv_hdr *reo_desc;
int ret;
spin_lock_bh(&srng->lock);
ath11k_hal_srng_access_begin(ab, srng);
- reo_desc = ath11k_hal_srng_src_get_next_entry(ab, srng);
+ reo_desc = (struct hal_tlv_hdr *)ath11k_hal_srng_src_get_next_entry(ab, srng);
if (!reo_desc) {
ret = -ENOBUFS;
goto out;
--
2.7.4
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2019-06-20 19:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 19:15 [PATCH 1/4] ath11k: change struct name from buffer_addr to ath11k_buffer_addr Muna Sinada
2019-06-20 19:15 ` [PATCH 2/4] ath11k: Use macros for magic arguments Muna Sinada
2019-06-20 19:15 ` Muna Sinada [this message]
2019-06-20 19:15 ` [PATCH 4/4] ath11k: removing unnecessary parentheses Muna Sinada
2019-06-24 10:50 ` [PATCH 1/4] ath11k: change struct name from buffer_addr to ath11k_buffer_addr Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1561058129-25625-3-git-send-email-msinada@codeaurora.org \
--to=msinada@codeaurora.org \
--cc=ath11k@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox