[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1258498555.6132.71.camel@macbook.infradead.org>
Date: Tue, 17 Nov 2009 22:55:55 +0000
From: David Woodhouse <david.woodhouse@...el.com>
To: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"chas@....nrl.navy.mil" <chas@....nrl.navy.mil>,
"nathan@...verse.com.au" <nathan@...verse.com.au>
Subject: Re: [patch 1/1] drivers/atm/solos-pci.c: fix warning/bug, clean up
code
On Tue, 2009-11-17 at 14:46 -0800, akpm@...ux-foundation.org wrote:
> From: Andrew Morton <akpm@...ux-foundation.org>
>
> drivers/atm/solos-pci.c: In function 'flash_upgrade':
> drivers/atm/solos-pci.c:528: warning: 'fw_name' may be used uninitialized in this function
>
> Cc: Chas Williams <chas@....nrl.navy.mil>
> Cc: Nathan Williams <nathan@...verse.com.au>
> Cc: David S. Miller <davem@...emloft.net>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Acked-By: David Woodhouse <David.Woodhouse@...el.com>
> ---
>
> drivers/atm/solos-pci.c | 29 ++++++++++++++++-------------
> 1 file changed, 16 insertions(+), 13 deletions(-)
>
> diff -puN drivers/atm/solos-pci.c~drivers-atm-solos-pcic-fix-warning-bug-clean-up-code drivers/atm/solos-pci.c
> --- a/drivers/atm/solos-pci.c~drivers-atm-solos-pcic-fix-warning-bug-clean-up-code
> +++ a/drivers/atm/solos-pci.c
> @@ -531,34 +531,37 @@ static int flash_upgrade(struct solos_ca
> int numblocks = 0;
> int offset;
>
> - if (chip == 0) {
> + switch (chip) {
> + case 0:
> fw_name = "solos-FPGA.bin";
> blocksize = FPGA_BLOCK;
> - }
> -
> - if (chip == 1) {
> + break;
> + case 1:
> fw_name = "solos-Firmware.bin";
> blocksize = SOLOS_BLOCK;
> - }
> -
> - if (chip == 2){
> + break;
> + case 2:
> if (card->fpga_version > LEGACY_BUFFERS){
> fw_name = "solos-db-FPGA.bin";
> blocksize = FPGA_BLOCK;
> } else {
> - dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n");
> + dev_info(&card->dev->dev, "FPGA version doesn't support"
> + " daughter board upgrades\n");
> return -EPERM;
> }
> - }
> -
> - if (chip == 3){
> + break;
> + case 3:
> if (card->fpga_version > LEGACY_BUFFERS){
> fw_name = "solos-Firmware.bin";
> blocksize = SOLOS_BLOCK;
> } else {
> - dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n");
> - return -EPERM;
> + dev_info(&card->dev->dev, "FPGA version doesn't support"
> + " daughter board upgrades\n");
> + return -EPERM;
> }
> + break;
> + default:
> + return -ENODEV;
> }
>
> if (request_firmware(&fw, fw_name, &card->dev->dev))
> _
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@...el.com Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists