lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8b2fbd3480fa4d2e08da0d1ea5a6f9860e6d8bea.1223497216.git.aciddeath@gmail.com>
Date:	Wed,  8 Oct 2008 14:41:40 -0600
From:	"Richard A. Holden III" <aciddeath@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	"Richard A. Holden III" <aciddeath@...il.com>,
	alan@...rguk.ukuu.org.uk
Subject: [PATCH 05/10] ixj: Move duplicate code into well named zero_caller_id function.

Signed-off-by: Richard A. Holden III <aciddeath@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ