aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/cthw20k1.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-08 08:57:57 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-08 08:57:57 -0400
commit514eef9c2a711b4c24b97bb456d39695a6fe1775 (patch)
tree0d98fb13304707682faa56d136249e9177a54932 /sound/pci/ctxfi/cthw20k1.c
parent4836ac655410e7f126d316b0be062b38746f7529 (diff)
ALSA: ctxfi - Remove useless initializations and cast
Remove useless variable initializations and cast at the beginning of functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthw20k1.c')
-rw-r--r--sound/pci/ctxfi/cthw20k1.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index b165466e1a54..38b87b6ee6d4 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -369,7 +369,7 @@ static unsigned int src_param_pitch_mixer(unsigned int src_idx)
369static int src_commit_write(struct hw *hw, unsigned int idx, void *blk) 369static int src_commit_write(struct hw *hw, unsigned int idx, void *blk)
370{ 370{
371 struct src_rsc_ctrl_blk *ctl = blk; 371 struct src_rsc_ctrl_blk *ctl = blk;
372 int i = 0; 372 int i;
373 373
374 if (ctl->dirty.bf.czbfs) { 374 if (ctl->dirty.bf.czbfs) {
375 /* Clear Z-Buffer registers */ 375 /* Clear Z-Buffer registers */
@@ -468,8 +468,8 @@ static int src_mgr_dsb_src(void *blk, unsigned int idx)
468static int src_mgr_commit_write(struct hw *hw, void *blk) 468static int src_mgr_commit_write(struct hw *hw, void *blk)
469{ 469{
470 struct src_mgr_ctrl_blk *ctl = blk; 470 struct src_mgr_ctrl_blk *ctl = blk;
471 int i = 0; 471 int i;
472 unsigned int ret = 0; 472 unsigned int ret;
473 473
474 if (ctl->dirty.bf.enbsa) { 474 if (ctl->dirty.bf.enbsa) {
475 do { 475 do {
@@ -1108,7 +1108,7 @@ static int daio_mgr_set_imapaddr(void *blk, unsigned int addr)
1108static int daio_mgr_commit_write(struct hw *hw, void *blk) 1108static int daio_mgr_commit_write(struct hw *hw, void *blk)
1109{ 1109{
1110 struct daio_mgr_ctrl_blk *ctl = blk; 1110 struct daio_mgr_ctrl_blk *ctl = blk;
1111 int i = 0; 1111 int i;
1112 1112
1113 if (ctl->dirty.bf.i2sictl || ctl->dirty.bf.i2soctl) { 1113 if (ctl->dirty.bf.i2sictl || ctl->dirty.bf.i2soctl) {
1114 for (i = 0; i < 4; i++) { 1114 for (i = 0; i < 4; i++) {
@@ -1212,8 +1212,8 @@ struct trn_conf {
1212 1212
1213static int hw_daio_init(struct hw *hw, const struct daio_conf *info) 1213static int hw_daio_init(struct hw *hw, const struct daio_conf *info)
1214{ 1214{
1215 u32 i2sorg = 0; 1215 u32 i2sorg;
1216 u32 spdorg = 0; 1216 u32 spdorg;
1217 1217
1218 /* Read I2S CTL. Keep original value. */ 1218 /* Read I2S CTL. Keep original value. */
1219 /*i2sorg = hw_read_20kx(hw, I2SCTL);*/ 1219 /*i2sorg = hw_read_20kx(hw, I2SCTL);*/
@@ -1263,8 +1263,8 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info)
1263/* TRANSPORT operations */ 1263/* TRANSPORT operations */
1264static int hw_trn_init(struct hw *hw, const struct trn_conf *info) 1264static int hw_trn_init(struct hw *hw, const struct trn_conf *info)
1265{ 1265{
1266 u32 trnctl = 0; 1266 u32 trnctl;
1267 unsigned long ptp_phys_low = 0, ptp_phys_high = 0; 1267 u32 ptp_phys_low, ptp_phys_high;
1268 1268
1269 /* Set up device page table */ 1269 /* Set up device page table */
1270 if ((~0UL) == info->vm_pgt_phys) { 1270 if ((~0UL) == info->vm_pgt_phys) {
@@ -1316,7 +1316,7 @@ static int hw_trn_init(struct hw *hw, const struct trn_conf *info)
1316static int hw_pll_init(struct hw *hw, unsigned int rsr) 1316static int hw_pll_init(struct hw *hw, unsigned int rsr)
1317{ 1317{
1318 unsigned int pllctl; 1318 unsigned int pllctl;
1319 int i = 0; 1319 int i;
1320 1320
1321 pllctl = (48000 == rsr) ? 0x1480a001 : 0x1480a731; 1321 pllctl = (48000 == rsr) ? 0x1480a001 : 0x1480a731;
1322 for (i = 0; i < 3; i++) { 1322 for (i = 0; i < 3; i++) {
@@ -1384,7 +1384,7 @@ static void i2c_lock(struct hw *hw)
1384 1384
1385static void i2c_write(struct hw *hw, u32 device, u32 addr, u32 data) 1385static void i2c_write(struct hw *hw, u32 device, u32 addr, u32 data)
1386{ 1386{
1387 unsigned int ret = 0; 1387 unsigned int ret;
1388 1388
1389 do { 1389 do {
1390 ret = hw_read_pci(hw, 0xEC); 1390 ret = hw_read_pci(hw, 0xEC);
@@ -1397,9 +1397,9 @@ static void i2c_write(struct hw *hw, u32 device, u32 addr, u32 data)
1397 1397
1398static int hw_reset_dac(struct hw *hw) 1398static int hw_reset_dac(struct hw *hw)
1399{ 1399{
1400 u32 i = 0; 1400 u32 i;
1401 u16 gpioorg = 0; 1401 u16 gpioorg;
1402 unsigned int ret = 0; 1402 unsigned int ret;
1403 1403
1404 if (i2c_unlock(hw)) 1404 if (i2c_unlock(hw))
1405 return -1; 1405 return -1;
@@ -1430,10 +1430,10 @@ static int hw_reset_dac(struct hw *hw)
1430 1430
1431static int hw_dac_init(struct hw *hw, const struct dac_conf *info) 1431static int hw_dac_init(struct hw *hw, const struct dac_conf *info)
1432{ 1432{
1433 u32 data = 0; 1433 u32 data;
1434 u16 gpioorg = 0; 1434 u16 gpioorg;
1435 u16 subsys_id = 0; 1435 u16 subsys_id;
1436 unsigned int ret = 0; 1436 unsigned int ret;
1437 1437
1438 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1438 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id);
1439 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { 1439 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) {
@@ -1494,13 +1494,12 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info)
1494 1494
1495static int is_adc_input_selected_SB055x(struct hw *hw, enum ADCSRC type) 1495static int is_adc_input_selected_SB055x(struct hw *hw, enum ADCSRC type)
1496{ 1496{
1497 u32 data = 0; 1497 return 0;
1498 return data;
1499} 1498}
1500 1499
1501static int is_adc_input_selected_SBx(struct hw *hw, enum ADCSRC type) 1500static int is_adc_input_selected_SBx(struct hw *hw, enum ADCSRC type)
1502{ 1501{
1503 u32 data = 0; 1502 u32 data;
1504 1503
1505 data = hw_read_20kx(hw, GPIO); 1504 data = hw_read_20kx(hw, GPIO);
1506 switch (type) { 1505 switch (type) {
@@ -1521,7 +1520,7 @@ static int is_adc_input_selected_SBx(struct hw *hw, enum ADCSRC type)
1521 1520
1522static int is_adc_input_selected_hendrix(struct hw *hw, enum ADCSRC type) 1521static int is_adc_input_selected_hendrix(struct hw *hw, enum ADCSRC type)
1523{ 1522{
1524 u32 data = 0; 1523 u32 data;
1525 1524
1526 data = hw_read_20kx(hw, GPIO); 1525 data = hw_read_20kx(hw, GPIO);
1527 switch (type) { 1526 switch (type) {
@@ -1539,7 +1538,7 @@ static int is_adc_input_selected_hendrix(struct hw *hw, enum ADCSRC type)
1539 1538
1540static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type) 1539static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type)
1541{ 1540{
1542 u16 subsys_id = 0; 1541 u16 subsys_id;
1543 1542
1544 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1543 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id);
1545 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { 1544 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) {
@@ -1559,7 +1558,7 @@ static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type)
1559static int 1558static int
1560adc_input_select_SB055x(struct hw *hw, enum ADCSRC type, unsigned char boost) 1559adc_input_select_SB055x(struct hw *hw, enum ADCSRC type, unsigned char boost)
1561{ 1560{
1562 u32 data = 0; 1561 u32 data;
1563 1562
1564 /* 1563 /*
1565 * check and set the following GPIO bits accordingly 1564 * check and set the following GPIO bits accordingly
@@ -1599,9 +1598,9 @@ adc_input_select_SB055x(struct hw *hw, enum ADCSRC type, unsigned char boost)
1599static int 1598static int
1600adc_input_select_SBx(struct hw *hw, enum ADCSRC type, unsigned char boost) 1599adc_input_select_SBx(struct hw *hw, enum ADCSRC type, unsigned char boost)
1601{ 1600{
1602 u32 data = 0; 1601 u32 data;
1603 u32 i2c_data = 0; 1602 u32 i2c_data;
1604 unsigned int ret = 0; 1603 unsigned int ret;
1605 1604
1606 if (i2c_unlock(hw)) 1605 if (i2c_unlock(hw))
1607 return -1; 1606 return -1;
@@ -1649,9 +1648,9 @@ adc_input_select_SBx(struct hw *hw, enum ADCSRC type, unsigned char boost)
1649static int 1648static int
1650adc_input_select_hendrix(struct hw *hw, enum ADCSRC type, unsigned char boost) 1649adc_input_select_hendrix(struct hw *hw, enum ADCSRC type, unsigned char boost)
1651{ 1650{
1652 u32 data = 0; 1651 u32 data;
1653 u32 i2c_data = 0; 1652 u32 i2c_data;
1654 unsigned int ret = 0; 1653 unsigned int ret;
1655 1654
1656 if (i2c_unlock(hw)) 1655 if (i2c_unlock(hw))
1657 return -1; 1656 return -1;
@@ -1693,7 +1692,7 @@ adc_input_select_hendrix(struct hw *hw, enum ADCSRC type, unsigned char boost)
1693 1692
1694static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) 1693static int hw_adc_input_select(struct hw *hw, enum ADCSRC type)
1695{ 1694{
1696 u16 subsys_id = 0; 1695 u16 subsys_id;
1697 1696
1698 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1697 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id);
1699 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { 1698 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) {
@@ -1719,8 +1718,8 @@ static int adc_init_SBx(struct hw *hw, int input, int mic20db)
1719{ 1718{
1720 u16 gpioorg; 1719 u16 gpioorg;
1721 u16 input_source; 1720 u16 input_source;
1722 u32 adcdata = 0; 1721 u32 adcdata;
1723 unsigned int ret = 0; 1722 unsigned int ret;
1724 1723
1725 input_source = 0x100; /* default to analog */ 1724 input_source = 0x100; /* default to analog */
1726 switch (input) { 1725 switch (input) {
@@ -1742,6 +1741,7 @@ static int adc_init_SBx(struct hw *hw, int input, int mic20db)
1742 input_source = 0x0; /* set to Digital */ 1741 input_source = 0x0; /* set to Digital */
1743 break; 1742 break;
1744 default: 1743 default:
1744 adcdata = 0x0;
1745 break; 1745 break;
1746 } 1746 }
1747 1747
@@ -1781,8 +1781,8 @@ static int adc_init_SBx(struct hw *hw, int input, int mic20db)
1781 1781
1782static int hw_adc_init(struct hw *hw, const struct adc_conf *info) 1782static int hw_adc_init(struct hw *hw, const struct adc_conf *info)
1783{ 1783{
1784 int err = 0; 1784 int err;
1785 u16 subsys_id = 0; 1785 u16 subsys_id;
1786 1786
1787 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1787 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id);
1788 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) { 1788 if ((subsys_id == 0x0022) || (subsys_id == 0x002F)) {
@@ -1797,7 +1797,7 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info)
1797 1797
1798static int hw_have_digit_io_switch(struct hw *hw) 1798static int hw_have_digit_io_switch(struct hw *hw)
1799{ 1799{
1800 u16 subsys_id = 0; 1800 u16 subsys_id;
1801 1801
1802 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id); 1802 pci_read_config_word(hw->pci, PCI_SUBSYSTEM_ID, &subsys_id);
1803 /* SB073x and Vista compatible cards have no digit IO switch */ 1803 /* SB073x and Vista compatible cards have no digit IO switch */
@@ -1814,11 +1814,11 @@ static int uaa_to_xfi(struct pci_dev *pci)
1814{ 1814{
1815 unsigned int bar0, bar1, bar2, bar3, bar4, bar5; 1815 unsigned int bar0, bar1, bar2, bar3, bar4, bar5;
1816 unsigned int cmd, irq, cl_size, l_timer, pwr; 1816 unsigned int cmd, irq, cl_size, l_timer, pwr;
1817 unsigned int is_uaa = 0; 1817 unsigned int is_uaa;
1818 unsigned int data[4] = {0}; 1818 unsigned int data[4] = {0};
1819 unsigned int io_base; 1819 unsigned int io_base;
1820 void *mem_base; 1820 void *mem_base;
1821 int i = 0; 1821 int i;
1822 const u32 CTLX = CTLBITS('C', 'T', 'L', 'X'); 1822 const u32 CTLX = CTLBITS('C', 'T', 'L', 'X');
1823 const u32 CTL_ = CTLBITS('C', 'T', 'L', '-'); 1823 const u32 CTL_ = CTLBITS('C', 'T', 'L', '-');
1824 const u32 CTLF = CTLBITS('C', 'T', 'L', 'F'); 1824 const u32 CTLF = CTLBITS('C', 'T', 'L', 'F');
@@ -1916,9 +1916,9 @@ static irqreturn_t ct_20k1_interrupt(int irq, void *dev_id)
1916 1916
1917static int hw_card_start(struct hw *hw) 1917static int hw_card_start(struct hw *hw)
1918{ 1918{
1919 int err = 0; 1919 int err;
1920 struct pci_dev *pci = hw->pci; 1920 struct pci_dev *pci = hw->pci;
1921 u16 subsys_id = 0; 1921 u16 subsys_id;
1922 1922
1923 err = pci_enable_device(pci); 1923 err = pci_enable_device(pci);
1924 if (err < 0) 1924 if (err < 0)
@@ -2004,8 +2004,8 @@ static int hw_card_init(struct hw *hw, struct card_conf *info)
2004{ 2004{
2005 int err; 2005 int err;
2006 unsigned int gctl; 2006 unsigned int gctl;
2007 u16 subsys_id = 0; 2007 u16 subsys_id;
2008 u32 data = 0; 2008 u32 data;
2009 struct dac_conf dac_info = {0}; 2009 struct dac_conf dac_info = {0};
2010 struct adc_conf adc_info = {0}; 2010 struct adc_conf adc_info = {0};
2011 struct daio_conf daio_info = {0}; 2011 struct daio_conf daio_info = {0};