From patchwork Mon Sep 29 09:03:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4994591 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 8749DBEEA6 for ; Mon, 29 Sep 2014 09:04:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 622EB20270 for ; Mon, 29 Sep 2014 09:04:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D43CB201FA for ; Mon, 29 Sep 2014 09:04:10 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 613C2260601; Mon, 29 Sep 2014 11:04:09 +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 F23F92605D4; Mon, 29 Sep 2014 11:03:56 +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 BBFB02605D4; Mon, 29 Sep 2014 11:03:55 +0200 (CEST) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 774F32605BE for ; Mon, 29 Sep 2014 11:03:47 +0200 (CEST) Received: by mail-pd0-f181.google.com with SMTP id z10so2874283pdj.26 for ; Mon, 29 Sep 2014 02:03:46 -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; bh=VaFGVhmwAghhPFWCG8A5oNeo4p8s0x2Z1SWmSdQQJYc=; b=Y6TcxPyZx8Cha81XTzA+jGXlJVVyoP5O3q1EagFXZn9/isWuBQUm8uz0Uhta1MYA1Y J7eMVn/ZAynJG9zpL/pG4f7fAdUmjw4bKf9JNmlwWvNPdGH4yd0mei1xof4K1WcIRmHC QuPkYixx/rCWZ6LQ0G2IIL5hrO7guTxkq83608f1zhDja1zHvpsibXO+0z1i1yzToKvv 8jmQl/ukAUcPHMLF1bszAUovFxwqP9vDyYztrRaQfvw12QcuZb6MgNw8KNx+S1akIqqk 2Sgc+Kch28QdaHYeUMq2YjfNDizn7+oaeHXmW0t5qJ8Gm+lebm82QwwDiXlDQh3A2/MF p9+A== X-Received: by 10.67.14.69 with SMTP id fe5mr56647825pad.73.1411981425940; Mon, 29 Sep 2014 02:03:45 -0700 (PDT) Received: from localhost.localdomain ([122.169.156.227]) by mx.google.com with ESMTPSA id v11sm11799385pas.24.2014.09.29.02.03.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 02:03:43 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Mon, 29 Sep 2014 14:33:21 +0530 Message-Id: <1411981406-10611-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: alsa-devel@alsa-project.org, Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v5 1/6] ALSA: ctxfi: changed void * 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 in the code we have void *hw and while using we are always typecasting it to (struct hw *). it is better to use void type of pointer when we store different types of pointer , but in this code we are only having struct hw. So changed all the relevant reference of void *hw to struct hw *hw, without any modification of the existing code logic. the next patch of the series will remove the typecasting which is not required now. Signed-off-by: Sudip Mukherjee --- sound/pci/ctxfi/ctamixer.c | 4 ++-- sound/pci/ctxfi/ctamixer.h | 4 ++-- sound/pci/ctxfi/ctatc.c | 4 ++-- sound/pci/ctxfi/ctatc.h | 2 +- sound/pci/ctxfi/ctdaio.c | 4 ++-- sound/pci/ctxfi/ctdaio.h | 6 +++--- sound/pci/ctxfi/ctresource.c | 5 +++-- sound/pci/ctxfi/ctresource.h | 9 +++++---- sound/pci/ctxfi/ctsrc.c | 4 ++-- sound/pci/ctxfi/ctsrc.h | 4 ++-- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c index fed6e6a..4671cbe7 100644 --- a/sound/pci/ctxfi/ctamixer.c +++ b/sound/pci/ctxfi/ctamixer.c @@ -296,7 +296,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer) return 0; } -int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr) +int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr) { int err; struct amixer_mgr *amixer_mgr; @@ -449,7 +449,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) return 0; } -int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr) +int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr) { int err; struct sum_mgr *sum_mgr; diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h index cc49e5a..6fa5eff 100644 --- a/sound/pci/ctxfi/ctamixer.h +++ b/sound/pci/ctxfi/ctamixer.h @@ -45,7 +45,7 @@ struct sum_mgr { }; /* Constructor and destructor of daio resource manager */ -int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr); +int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr); int sum_mgr_destroy(struct sum_mgr *sum_mgr); /* Define the descriptor of a amixer resource */ @@ -90,7 +90,7 @@ struct amixer_mgr { }; /* Constructor and destructor of amixer resource manager */ -int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr); +int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr); int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr); #endif /* CTAMIXER_H */ diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index d92a08c..04e54cc 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -106,11 +106,11 @@ static struct { .public_name = "Mixer"} }; -typedef int (*create_t)(void *, void **); +typedef int (*create_t)(struct hw *, void **); typedef int (*destroy_t)(void *); static struct { - int (*create)(void *hw, void **rmgr); + int (*create)(struct hw *hw, void **rmgr); int (*destroy)(void *mgr); } rsc_mgr_funcs[NUM_RSCTYP] = { [SRC] = { .create = (create_t)src_mgr_create, diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h index 5f11ca2..5641334 100644 --- a/sound/pci/ctxfi/ctatc.h +++ b/sound/pci/ctxfi/ctatc.h @@ -131,7 +131,7 @@ struct ct_atc { /* Don't touch! Used for internal object. */ void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */ void *mixer; /* internal mixer object */ - void *hw; /* chip specific hardware access object */ + struct hw *hw; /* chip specific hardware access object */ void **daios; /* digital audio io resources */ void **pcm; /* SUMs for collecting all pcm stream */ void **srcs; /* Sample Rate Converters for input signal */ diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 6f0654e..7541641 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c @@ -331,7 +331,7 @@ static struct dai_rsc_ops dai_ops = { static int daio_rsc_init(struct daio *daio, const struct daio_desc *desc, - void *hw) + struct hw *hw) { int err; unsigned int idx_l, idx_r; @@ -692,7 +692,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr) return 0; } -int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) +int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr) { int err, i; struct daio_mgr *daio_mgr; diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h index 85ccb6e..e4817de 100644 --- a/sound/pci/ctxfi/ctdaio.h +++ b/sound/pci/ctxfi/ctdaio.h @@ -53,14 +53,14 @@ struct dao { struct dao_rsc_ops *ops; /* DAO specific operations */ struct imapper **imappers; struct daio_mgr *mgr; - void *hw; + struct hw *hw; void *ctrl_blk; }; struct dai { struct daio daio; struct dai_rsc_ops *ops; /* DAI specific operations */ - void *hw; + struct hw *hw; void *ctrl_blk; }; @@ -117,7 +117,7 @@ struct daio_mgr { }; /* Constructor and destructor of daio resource manager */ -int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr); +int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr); int daio_mgr_destroy(struct daio_mgr *daio_mgr); #endif /* CTDAIO_H */ diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c index e49d2be..f14cbea 100644 --- a/sound/pci/ctxfi/ctresource.c +++ b/sound/pci/ctxfi/ctresource.c @@ -134,7 +134,8 @@ static struct rsc_ops rsc_generic_ops = { .next_conj = rsc_next_conj, }; -int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw) +int +rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw) { int err = 0; @@ -206,7 +207,7 @@ int rsc_uninit(struct rsc *rsc) } int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, - unsigned int amount, void *hw_obj) + unsigned int amount, struct hw *hw_obj) { int err = 0; struct hw *hw = hw_obj; diff --git a/sound/pci/ctxfi/ctresource.h b/sound/pci/ctxfi/ctresource.h index 0838c2e..9b746c3 100644 --- a/sound/pci/ctxfi/ctresource.h +++ b/sound/pci/ctxfi/ctresource.h @@ -38,7 +38,7 @@ struct rsc { u32 conj:12; /* Current conjugate index */ u32 msr:4; /* The Master Sample Rate a resource working on */ void *ctrl_blk; /* Chip specific control info block for a resource */ - void *hw; /* Chip specific object for hardware access means */ + struct hw *hw; /* Chip specific object for hardware access means */ struct rsc_ops *ops; /* Generic resource operations */ }; @@ -50,7 +50,8 @@ struct rsc_ops { int (*output_slot)(const struct rsc *rsc); }; -int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw); +int +rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw); int rsc_uninit(struct rsc *rsc); struct rsc_mgr { @@ -59,12 +60,12 @@ struct rsc_mgr { unsigned int avail; /* The amount of currently available resources */ unsigned char *rscs; /* The bit-map for resource allocation */ void *ctrl_blk; /* Chip specific control info block */ - void *hw; /* Chip specific object for hardware access */ + struct hw *hw; /* Chip specific object for hardware access */ }; /* Resource management is based on bit-map mechanism */ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, - unsigned int amount, void *hw); + unsigned int amount, struct hw *hw); int rsc_mgr_uninit(struct rsc_mgr *mgr); int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index 19df9b4..342008f 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c @@ -543,7 +543,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr) return 0; } -int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr) +int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr) { int err, i; struct src_mgr *src_mgr; @@ -825,7 +825,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) return err; } -int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr) +int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr) { int err; struct srcimp_mgr *srcimp_mgr; diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h index 259366a..6d95afb 100644 --- a/sound/pci/ctxfi/ctsrc.h +++ b/sound/pci/ctxfi/ctsrc.h @@ -140,10 +140,10 @@ struct srcimp_mgr { }; /* Constructor and destructor of SRC resource manager */ -int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr); +int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr); int src_mgr_destroy(struct src_mgr *src_mgr); /* Constructor and destructor of SRCIMP resource manager */ -int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrc_mgr); +int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr); int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr); #endif /* CTSRC_H */