From patchwork Thu Jun 20 19:15:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muna Sinada X-Patchwork-Id: 11007809 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC2AD1398 for ; Thu, 20 Jun 2019 19:15:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCFB72881A for ; Thu, 20 Jun 2019 19:15:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D135228856; Thu, 20 Jun 2019 19:15:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 659FD28846 for ; Thu, 20 Jun 2019 19:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HccMZ3ifGAxjEcW6GL3lRPOOQESloOpR0i2YUQK4FPg=; b=l9Khzg4duvyHWfWopIccfVYPM4 zdYpA8CagvMNIs05JgTvRdI7Nsu6uUAvEyB5iPufbwe/Kx4CEGfBqoA8m6CDk5JSDdOHcPQNjYwDi OEvKrlZT7KuRhRzxWrhbJuBzHwSCBuYoalnNhmJC458/Dxb6BlMueHLetxsH3mQ0ghLcQr606LPrc 23Kg0VwxbRNSBG25mkxG+s/EBnorioM8alZT22+apSRnH0D20Gh8EgdaYPEH21+UzfWd0N5vTQt9D BFCxc3iuVLRGioRJS+JaoOm3IqSLF4Wzp09usgAsoRxPlx5IPbVaz0vF0RkoP81w4izlsWz2mqMKP WqwsmyQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1he2XO-0001uX-Dw; Thu, 20 Jun 2019 19:15:58 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1he2XL-0001tA-Bb for ath11k@lists.infradead.org; Thu, 20 Jun 2019 19:15:56 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 24D476028D; Thu, 20 Jun 2019 19:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561058155; bh=DDAfFUOOPviJdPw/Yt31S6NZavQKSvUhNyfQgOAU+xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GrLnN5/Bwgs7V3hDiQXXr7D/o9p48NzjCkiU6PF3xV+3HmQXGgP6fOVlg0ockjyu+ u0mrjXD056a+6MWWPPCslrLIPc12UVE8oCs94OM4EYPyBhWFb6wniUA9hGrYdz9ean GKAQfdxtIbAhpOx7o97SgAQnq6ymtd6WT0ojbqGw= Received: from msinada-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: msinada@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 842A660867; Thu, 20 Jun 2019 19:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561058154; bh=DDAfFUOOPviJdPw/Yt31S6NZavQKSvUhNyfQgOAU+xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gZ0qqB7IJ7QMmR1ig2ClRKlaAGEbpDaf2ZDtfxRfn5xyq7DY0nd6LqnCLyPpx3TOC UKiVYq1SLC8TRnS+dY3dxG7ZrEbAZd4BKdwOS15nqVQbgUlyiNiGdMxCzO5zb945Oy UNqUFHpj2zxlUjgmAmcLv3JSAi7llF9kARorBdhE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 842A660867 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=msinada@codeaurora.org From: Muna Sinada To: ath11k@lists.infradead.org Subject: [PATCH 3/4] ath11k: cast reo_desc directly to struct hal_tlv_hdr Date: Thu, 20 Jun 2019 12:15:28 -0700 Message-Id: <1561058129-25625-3-git-send-email-msinada@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561058129-25625-1-git-send-email-msinada@codeaurora.org> References: <1561058129-25625-1-git-send-email-msinada@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_121555_427173_0B2BD3EF X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Muna Sinada MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;