From: "Richard A. Holden III" <aciddeath@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "Richard A. Holden III" <aciddeath@gmail.com>, alan@lxorguk.ukuu.org.uk
Subject: [PATCH 05/10] ixj: Move duplicate code into well named zero_caller_id function.
Date: Wed, 8 Oct 2008 14:41:40 -0600 [thread overview]
Message-ID: <8b2fbd3480fa4d2e08da0d1ea5a6f9860e6d8bea.1223497216.git.aciddeath@gmail.com> (raw)
In-Reply-To: <659ee5c8af676929264fafd812d539c372f6ee9d.1223497216.git.aciddeath@gmail.com>
In-Reply-To: <cover.1223497216.git.aciddeath@gmail.com>
Signed-off-by: Richard A. Holden III <aciddeath@gmail.com>
---
drivers/telephony/ixj.c | 52 +++++++++++-----------------------------------
1 files changed, 13 insertions(+), 39 deletions(-)
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index 1f91a59..80a31e4 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -7737,16 +7737,20 @@ static void set_25hz_30v_levemetering_ringing(IXJ *j)
j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x8E;
}
-static void DAA_Coeff_US(IXJ *j)
+static void zero_caller_id(IXJ *j)
{
- int i;
-
- j->daa_country = DAA_US;
/*----------------------------------------------- */
/* CAO */
+ int i;
for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
}
+}
+
+static void DAA_Coeff_US(IXJ *j)
+{
+ j->daa_country = DAA_US;
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 0E,32,E2,2F,C2,5A,C0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x03;
@@ -7902,14 +7906,8 @@ static void DAA_Coeff_US(IXJ *j)
static void DAA_Coeff_UK(IXJ *j)
{
- int i;
-
j->daa_country = DAA_UK;
- /*----------------------------------------------- */
- /* CAO */
- for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
- j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
- }
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 00,C2,BB,A8,CB,81,A0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
@@ -8061,14 +8059,8 @@ static void DAA_Coeff_UK(IXJ *j)
static void DAA_Coeff_France(IXJ *j)
{
- int i;
-
j->daa_country = DAA_FRANCE;
- /*----------------------------------------------- */
- /* CAO */
- for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
- j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
- }
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 02,A2,43,2C,22,AF,A0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x02;
@@ -8220,14 +8212,8 @@ static void DAA_Coeff_France(IXJ *j)
static void DAA_Coeff_Germany(IXJ *j)
{
- int i;
-
j->daa_country = DAA_GERMANY;
- /*----------------------------------------------- */
- /* CAO */
- for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
- j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
- }
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 00,CE,BB,B8,D2,81,B0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
@@ -8400,14 +8386,8 @@ static void DAA_Coeff_Germany(IXJ *j)
static void DAA_Coeff_Australia(IXJ *j)
{
- int i;
-
j->daa_country = DAA_AUSTRALIA;
- /*----------------------------------------------- */
- /* CAO */
- for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
- j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
- }
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 00,A3,AA,28,B3,82,D0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
@@ -8559,14 +8539,8 @@ static void DAA_Coeff_Australia(IXJ *j)
static void DAA_Coeff_Japan(IXJ *j)
{
- int i;
-
j->daa_country = DAA_JAPAN;
- /*----------------------------------------------- */
- /* CAO */
- for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
- j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
- }
+ zero_caller_id(j);
/* Bytes for IM-filter part 1 (04): 06,BD,E2,2D,BA,F9,A0,00 */
j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x06;
--
1.5.6.4
next prev parent reply other threads:[~2008-10-08 19:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 20:41 [PATCH 00/10] ixj: Cleanup dead and duplicate code Richard A. Holden III
2008-10-08 20:12 ` Alan Cox
2008-10-08 20:41 ` [PATCH 01/10] ixj: Remove code duplication for processing codec names Richard A. Holden III
2008-10-08 20:41 ` [PATCH 02/10] ixj: Remove dead code in preparation for consolidating duplicate code Richard A. Holden III
2008-10-08 20:41 ` [PATCH 03/10] ixj: Unify comments in preparation for pushing duplicate code into a function Richard A. Holden III
2008-10-08 20:41 ` [PATCH 04/10] ixj: Consolidate duplicate Ringer array initializers into common functions Richard A. Holden III
2008-10-08 20:41 ` Richard A. Holden III [this message]
2008-10-08 20:41 ` [PATCH 06/10] ixj: Caller ID Refactoring Richard A. Holden III
2008-10-08 20:41 ` [PATCH 07/10] ixj: Refactor DTMF tone setting Richard A. Holden III
2008-10-08 20:41 ` [PATCH 08/10] ixj: update quickly readable comments to match the data initializations Richard A. Holden III
2008-10-08 20:41 ` [PATCH 09/10] ixj: Remove unused macro Richard A. Holden III
2008-10-08 20:41 ` [PATCH 10/10] ixj: Remove dead code from ifdef IXJ_DYN_ALLOC Richard A. Holden III
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=8b2fbd3480fa4d2e08da0d1ea5a6f9860e6d8bea.1223497216.git.aciddeath@gmail.com \
--to=aciddeath@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®