From patchwork Mon Sep 29 09:03:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4994651 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 585A5BEEA6 for ; Mon, 29 Sep 2014 09:04:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8761520266 for ; Mon, 29 Sep 2014 09:04:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3C185201FA for ; Mon, 29 Sep 2014 09:04:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2FAFC260606; Mon, 29 Sep 2014 11:04:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A5AC92605C1; Mon, 29 Sep 2014 11:04:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 94DBB2605EB; Mon, 29 Sep 2014 11:04:01 +0200 (CEST) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by alsa0.perex.cz (Postfix) with ESMTP id 14F1D2605C1 for ; Mon, 29 Sep 2014 11:03:49 +0200 (CEST) Received: by mail-pd0-f169.google.com with SMTP id p10so4907549pdj.28 for ; Mon, 29 Sep 2014 02:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WzVswht4HYvKerTObZlQQmUQkInIdUn/T10u3CmmlDs=; b=qqoWg4zngR/7zlquZjrr7Fz4EmJm3r8rum6gKpyrZrkmS4ohZqKv7Tkza9fFQf+EC0 L3+wVNWFEKoeu3bXUu+EInRvb5ohioKU41SBEpomCU4su9T3zdpjj32MFwc40LtL5G6Q AqCbEMxJByFZXZTJZxMXjAtDDaFv/wRNyG3T+gy3wT41Pwu3ZxxtrrA7oi4Iw8Y4H52A 7Wmtkd87YZLS249vOSZv9wYhEuvcgOV7Gx50P6vH5qkrGbJQlpzCSEKFrpxuUOhE8KDf KkL/9DfNaUwc4gtkteGc4lkXnuH2Jc1lKtIuSq9nEsx2fQFD5398gEA0WtM9a7gtM3DD MSqw== X-Received: by 10.67.4.163 with SMTP id cf3mr57277379pad.92.1411981428673; Mon, 29 Sep 2014 02:03:48 -0700 (PDT) Received: from localhost.localdomain ([122.169.156.227]) by mx.google.com with ESMTPSA id v11sm11799385pas.24.2014.09.29.02.03.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 02:03:48 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Mon, 29 Sep 2014 14:33:22 +0530 Message-Id: <1411981406-10611-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1411981406-10611-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1411981406-10611-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v5 2/6] ALSA: ctxfi: removed typecast to (struct hw *) X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP the previous patch of the series has converted the void * to struct hw * . Now this patch removes the typecasting to (struct hw *) which is not needed any more. Signed-off-by: Sudip Mukherjee --- sound/pci/ctxfi/ctatc.c | 2 +- sound/pci/ctxfi/ctresource.c | 26 +++++++++----------------- sound/pci/ctxfi/ctsrc.c | 6 +++--- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 04e54cc..e536ab9 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1235,7 +1235,7 @@ static int ct_atc_destroy(struct ct_atc *atc) } if (atc->hw) - destroy_hw_obj((struct hw *)atc->hw); + destroy_hw_obj(atc->hw); /* Destroy device virtual memory manager object */ if (atc->vm) { diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c index f14cbea..5aac63f 100644 --- a/sound/pci/ctxfi/ctresource.c +++ b/sound/pci/ctxfi/ctresource.c @@ -152,11 +152,10 @@ rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw) switch (type) { case SRC: - err = ((struct hw *)hw)->src_rsc_get_ctrl_blk(&rsc->ctrl_blk); + err = hw->src_rsc_get_ctrl_blk(&rsc->ctrl_blk); break; case AMIXER: - err = ((struct hw *)hw)-> - amixer_rsc_get_ctrl_blk(&rsc->ctrl_blk); + err = hw->amixer_rsc_get_ctrl_blk(&rsc->ctrl_blk); break; case SRCIMP: case SUM: @@ -180,12 +179,10 @@ int rsc_uninit(struct rsc *rsc) if ((NULL != rsc->hw) && (NULL != rsc->ctrl_blk)) { switch (rsc->type) { case SRC: - ((struct hw *)rsc->hw)-> - src_rsc_put_ctrl_blk(rsc->ctrl_blk); + rsc->hw->src_rsc_put_ctrl_blk(rsc->ctrl_blk); break; case AMIXER: - ((struct hw *)rsc->hw)-> - amixer_rsc_put_ctrl_blk(rsc->ctrl_blk); + rsc->hw->amixer_rsc_put_ctrl_blk(rsc->ctrl_blk); break; case SUM: case DAIO: @@ -207,10 +204,9 @@ int rsc_uninit(struct rsc *rsc) } int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, - unsigned int amount, struct hw *hw_obj) + unsigned int amount, struct hw *hw) { int err = 0; - struct hw *hw = hw_obj; mgr->type = NUM_RSCTYP; @@ -265,20 +261,16 @@ int rsc_mgr_uninit(struct rsc_mgr *mgr) if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) { switch (mgr->type) { case SRC: - ((struct hw *)mgr->hw)-> - src_mgr_put_ctrl_blk(mgr->ctrl_blk); + mgr->hw->src_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case SRCIMP: - ((struct hw *)mgr->hw)-> - srcimp_mgr_put_ctrl_blk(mgr->ctrl_blk); + mgr->hw->srcimp_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case AMIXER: - ((struct hw *)mgr->hw)-> - amixer_mgr_put_ctrl_blk(mgr->ctrl_blk); + mgr->hw->amixer_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case DAIO: - ((struct hw *)mgr->hw)-> - daio_mgr_put_ctrl_blk(mgr->ctrl_blk); + mgr->hw->daio_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case SUM: break; diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index 342008f..d3ef213 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c @@ -558,7 +558,7 @@ int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr) goto error1; spin_lock_init(&src_mgr->mgr_lock); - conj_mask = ((struct hw *)hw)->src_dirty_conj_mask(); + conj_mask = hw->src_dirty_conj_mask(); src_mgr->get_src = get_src_rsc; src_mgr->put_src = put_src_rsc; @@ -569,9 +569,9 @@ int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr) /* Disable all SRC resources. */ for (i = 0; i < 256; i++) - ((struct hw *)hw)->src_mgr_dsb_src(src_mgr->mgr.ctrl_blk, i); + hw->src_mgr_dsb_src(src_mgr->mgr.ctrl_blk, i); - ((struct hw *)hw)->src_mgr_commit_write(hw, src_mgr->mgr.ctrl_blk); + hw->src_mgr_commit_write(hw, src_mgr->mgr.ctrl_blk); *rsrc_mgr = src_mgr;