Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 910f7bb1 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Jeff Garzik
Browse files

pata_hpt37x: fold 'if' statement into 'switch'



hpt37x_init_one() has a large *if* statement which should really be folded into
the *switch* statement that currently constitutes its *else* branch, reducing
one level of indentation...

Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 40d69ba0
Loading
Loading
Loading
Loading
+43 −46
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@
#include <linux/libata.h>
#include <linux/libata.h>


#define DRV_NAME	"pata_hpt37x"
#define DRV_NAME	"pata_hpt37x"
#define DRV_VERSION	"0.6.20"
#define DRV_VERSION	"0.6.21"


struct hpt_clock {
struct hpt_clock {
	u8	xfer_speed;
	u8	xfer_speed;
@@ -838,7 +838,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
	if (rc)
	if (rc)
		return rc;
		return rc;


	if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
	switch (dev->device) {
	case PCI_DEVICE_ID_TTI_HPT366:
		/* May be a later chip in disguise. Check */
		/* May be a later chip in disguise. Check */
		/* Older chips are in the HPT366 driver. Ignore them */
		/* Older chips are in the HPT366 driver. Ignore them */
		if (rev < 3)
		if (rev < 3)
@@ -867,8 +868,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			       "please report (%d).\n", rev);
			       "please report (%d).\n", rev);
			return -ENODEV;
			return -ENODEV;
		}
		}
	} else {
		break;
		switch (dev->device) {
	case PCI_DEVICE_ID_TTI_HPT372:
	case PCI_DEVICE_ID_TTI_HPT372:
		/* 372N if rev >= 2 */
		/* 372N if rev >= 2 */
		if (rev >= 2)
		if (rev >= 2)
@@ -890,9 +890,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
		ppi[0] = &info_hpt302;
		ppi[0] = &info_hpt302;
		chip_table = &hpt371;
		chip_table = &hpt371;
		/*
		/*
			 * Single channel device, master is not present
		 * Single channel device, master is not present but the BIOS
			 * but the BIOS (or us for non x86) must mark it
		 * (or us for non x86) must mark it absent
			 * absent
		 */
		 */
		pci_read_config_byte(dev, 0x50, &mcr1);
		pci_read_config_byte(dev, 0x50, &mcr1);
		mcr1 &= ~0x04;
		mcr1 &= ~0x04;
@@ -906,12 +905,10 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
			*ppi = &info_hpt374_fn1;
			*ppi = &info_hpt374_fn1;
		break;
		break;
	default:
	default:
			pr_err(DRV_NAME
		pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n",
			       ": PCI table is bogus, please report (%d).\n",
		       dev->device);
		       dev->device);
		return -ENODEV;
		return -ENODEV;
	}
	}
	}
	/* Ok so this is a chip we support */
	/* Ok so this is a chip we support */


	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));