mxser: fix compile warning building without CONFIG_PCI
Subsystems (2)
PATCH 1/1 mxser: fix compile warning building without CONFIG_PCI
When build without CONFIG_PIC, got the following warnings:
drivers/char/mxser.c: In function 'mxser_init':drivers/char/mxser.c:698: warning: unused variable 'devnum' drivers/char/mxser.c:698: warning: unused variable 'busnum' drivers/char/mxser.c:697: warning: unused variable 'index' drivers/char/mxser.c:696: warning: unused variable 'pdev' drivers/char/mxser.c:695: warning: unused variable 'n'
--- drivers/char/mxser.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)
drivers/char/mxser.c +6 -8
@@ -692,10 +692,7 @@ static int mxser_get_PCI_conf(int busnum, int devnum, int board_type, struct mxsstatic int mxser_init (void ) { -int i, m, retval, b, n; -struct pci_dev *pdev =NULL ; -int index; -unsigned char busnum, devnum; +int i, m, retval, b;struct mxser_hwconf hwconf; mxvar_sdriver =alloc_tty_driver (MXSER_PORTS +1 );
@@ -834,10 +831,11 @@ static int mxser_init(void)/* start finding PCI board here */ #ifdef CONFIG_PCI - n =ARRAY_SIZE (mxser_pcibrds) -1 ; - index =0 ; b =0 ; -while (b < n) { +while (b <ARRAY_SIZE (mxser_pcibrds)-1 ) { +unsigned char busnum, devnum; +struct pci_dev *pdev; + pdev =pci_get_device (mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);if (pdev ==NULL ) {
@@ -850,7 +848,7 @@ static int mxser_init(void)printk (KERN_INFO "Found MOXA %s board(BusNo=%d,DevNo=%d)\n" , mxser_brdname[(int ) (mxser_pcibrds[b].driver_data) -1 ], busnum, devnum >>3 ); - index++; +if (m >=MXSER_BOARDS )printk (KERN_ERR "Too many Smartio/Industio family boards find "
Signature · 1 line
1.5.4.rc3
Quoted 35 lines · Li Zefan
When build without
CONFIG_PIC, got the following warnings:
drivers/char/mxser.c: In function 'mxser_init':drivers/char/mxser.c:698: warning: unused variable 'devnum'drivers/char/mxser.c:698: warning: unused variable 'busnum'drivers/char/mxser.c:697: warning: unused variable 'index'drivers/char/mxser.c:696: warning: unused variable 'pdev'drivers/char/mxser.c:695: warning: unused variable 'n'Signed-off-by Li Zefan <[email protected]>--- drivers/char/mxser.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)drivers/char/mxser.c +1
-5@@ -692,10 +692,7 @@ static int mxser_get_PCI_conf(int busnum, int devnum, int board_type, struct mxsstatic int mxser_init (void ) { -int i, m, retval, b, n; -struct pci_dev *pdev =NULL ; -int index; -unsigned char busnum, devnum; +int i, m, retval, b;struct mxser_hwconf hwconf; mxvar_sdriver =alloc_tty_driver (MXSER_PORTS +1 );@@ -834,10 +831,11 @@ static int mxser_init(void)/* start finding PCI board here */ #ifdef CONFIG_PCI - n =ARRAY_SIZE (mxser_pcibrds) -1 ;
drivers/char/mxser.c static int mxser_init(void) · line 841
Quoted 10 lines
drivers/char/mxser.c +4
-2- index =0 ; b =0 ; -while (b < n) { +while (b <ARRAY_SIZE (mxser_pcibrds)-1 ) { +unsigned char busnum, devnum; +struct pci_dev *pdev; + pdev =pci_get_device (mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);if (pdev ==NULL ) {
This version of driver is no longer in -mm.
Quoted 34 lines · Jiri Slaby
Quoted 33 lines · Li Zefan
When build without
CONFIG_PIC, got the following warnings:
drivers/char/mxser.c: In function 'mxser_init':drivers/char/mxser.c:698: warning: unused variable 'devnum'drivers/char/mxser.c:698: warning: unused variable 'busnum'drivers/char/mxser.c:697: warning: unused variable 'index'drivers/char/mxser.c:696: warning: unused variable 'pdev'drivers/char/mxser.c:695: warning: unused variable 'n'Signed-off-by Li Zefan <[email protected]>--- drivers/char/mxser.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)drivers/char/mxser.c +0
-0@@ -692,10 +692,7 @@ static int mxser_get_PCI_conf(int busnum, intdevnum, int
board_type, struct mxsstatic int
mxser_init(void)
{drivers/char/mxser.c +1
-4-int i, m, retval, b, n; -struct pci_dev *pdev =NULL ; -int index; -unsigned char busnum, devnum; +int i, m, retval, b;struct mxser_hwconf hwconf; mxvar_sdriver =alloc_tty_driver (MXSER_PORTS +1 );@@ -834,10 +831,11 @@ static int mxser_init(void)
Quoted 16 lines
drivers/char/mxser.c static int mxser_init(void) · line 841
Quoted 13 lines
drivers/char/mxser.c +4
-3/* start finding PCI board here */ #ifdef CONFIG_PCI - n =ARRAY_SIZE (mxser_pcibrds) -1 ; - index =0 ; b =0 ; -while (b < n) { +while (b <ARRAY_SIZE (mxser_pcibrds)-1 ) { +unsigned char busnum, devnum; +struct pci_dev *pdev; + pdev =pci_get_device (mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);if (pdev ==NULL ) {This version of driver is no longer in -mm.
I didn't know this, so just silently ignore this patch. :)