public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Minor EISA cleanup
@ 2018-01-17  9:39 Ladislav Michl
  2018-01-17  9:44 ` [PATCH 1/2] EISA: Whitespace cleanup Ladislav Michl
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ladislav Michl @ 2018-01-17  9:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Bjorn Helgaas, Marc Zyngier

Hi,

this is nothing dramatic, just whitespace cleanup and one error
logging line deletion. Sending it as preparation for SGI Indigo2
related patches which I'm unsure ever happens as my machine
stopped working few days ago.

Ladislav Michl (2):
  EISA: Whitespace cleanup
  EISA: Delete error message for a failed memory allocation in
    eisa_probe()

 drivers/eisa/eisa-bus.c     | 28 +++++++++++++---------------
 drivers/eisa/virtual_root.c |  4 ++--
 2 files changed, 15 insertions(+), 17 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] EISA: Whitespace cleanup
  2018-01-17  9:39 [PATCH 0/2] Minor EISA cleanup Ladislav Michl
@ 2018-01-17  9:44 ` Ladislav Michl
  2018-01-17  9:45 ` [PATCH 2/2] EISA: Delete error message for a failed memory allocation in eisa_probe() Ladislav Michl
  2018-01-17 10:20 ` [PATCH 0/2] Minor EISA cleanup Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Ladislav Michl @ 2018-01-17  9:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Bjorn Helgaas, Marc Zyngier

Remove spaces on empty line and replace spaces with tabs.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 drivers/eisa/eisa-bus.c     | 58 ++++++++++++++++++++++-----------------------
 drivers/eisa/pci_eisa.c     | 10 ++++----
 drivers/eisa/virtual_root.c | 19 +++++++--------
 3 files changed, 43 insertions(+), 44 deletions(-)

diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 612afeaec3cb..4155507052bd 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -75,9 +75,9 @@ static void __init eisa_name_device(struct eisa_device *edev)
 
 static char __init *decode_eisa_sig(unsigned long addr)
 {
-        static char sig_str[EISA_SIG_LEN];
+	static char sig_str[EISA_SIG_LEN];
 	u8 sig[4];
-        u16 rev;
+	u16 rev;
 	int i;
 
 	for (i = 0; i < 4; i++) {
@@ -96,14 +96,14 @@ static char __init *decode_eisa_sig(unsigned long addr)
 		if (!i && (sig[0] & 0x80))
 			return NULL;
 	}
-	
-        sig_str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1);
-        sig_str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1);
-        sig_str[2] = (sig[1] & 0x1f) + ('A' - 1);
-        rev = (sig[2] << 8) | sig[3];
-        sprintf(sig_str + 3, "%04X", rev);
-
-        return sig_str;
+
+	sig_str[0] = ((sig[0] >> 2) & 0x1f) + ('A' - 1);
+	sig_str[1] = (((sig[0] & 3) << 3) | (sig[1] >> 5)) + ('A' - 1);
+	sig_str[2] = (sig[1] & 0x1f) + ('A' - 1);
+	rev = (sig[2] << 8) | sig[3];
+	sprintf(sig_str + 3, "%04X", rev);
+
+	return sig_str;
 }
 
 static int eisa_bus_match(struct device *dev, struct device_driver *drv)
@@ -198,7 +198,7 @@ static int __init eisa_init_device(struct eisa_root_device *root,
 	sig = decode_eisa_sig(sig_addr);
 	if (!sig)
 		return -1;	/* No EISA device here */
-	
+
 	memcpy(edev->id.sig, sig, EISA_SIG_LEN);
 	edev->slot = slot;
 	edev->state = inb(SLOT_ADDRESS(root, slot) + EISA_CONFIG_OFFSET)
@@ -222,7 +222,7 @@ static int __init eisa_init_device(struct eisa_root_device *root,
 
 	if (is_forced_dev(enable_dev, enable_dev_count, root, edev))
 		edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED;
-	
+
 	if (is_forced_dev(disable_dev, disable_dev_count, root, edev))
 		edev->state = EISA_CONFIG_FORCED;
 
@@ -275,7 +275,7 @@ static int __init eisa_request_resources(struct eisa_root_device *root,
 			edev->res[i].start = edev->res[i].end = 0;
 			continue;
 		}
-		
+
 		if (slot) {
 			edev->res[i].name  = NULL;
 			edev->res[i].start = SLOT_ADDRESS(root, slot)
@@ -295,7 +295,7 @@ static int __init eisa_request_resources(struct eisa_root_device *root,
 	}
 
 	return 0;
-	
+
  failed:
 	while (--i >= 0)
 		release_resource(&edev->res[i]);
@@ -314,7 +314,7 @@ static void __init eisa_release_resources(struct eisa_device *edev)
 
 static int __init eisa_probe(struct eisa_root_device *root)
 {
-        int i, c;
+	int i, c;
 	struct eisa_device *edev;
 	char *enabled_str;
 
@@ -322,16 +322,16 @@ static int __init eisa_probe(struct eisa_root_device *root)
 
 	/* First try to get hold of slot 0. If there is no device
 	 * here, simply fail, unless root->force_probe is set. */
-	
+
 	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
 	if (!edev) {
 		dev_err(root->dev, "EISA: Couldn't allocate mainboard slot\n");
 		return -ENOMEM;
 	}
-		
+
 	if (eisa_request_resources(root, edev, 0)) {
 		dev_warn(root->dev,
-		         "EISA: Cannot allocate resource for mainboard\n");
+			 "EISA: Cannot allocate resource for mainboard\n");
 		kfree(edev);
 		if (!root->force_probe)
 			return -EBUSY;
@@ -350,14 +350,14 @@ static int __init eisa_probe(struct eisa_root_device *root)
 
 	if (eisa_register_device(edev)) {
 		dev_err(&edev->dev, "EISA: Failed to register %s\n",
-		        edev->id.sig);
+			edev->id.sig);
 		eisa_release_resources(edev);
 		kfree(edev);
 	}
-	
+
  force_probe:
-	
-        for (c = 0, i = 1; i <= root->slots; i++) {
+
+	for (c = 0, i = 1; i <= root->slots; i++) {
 		edev = kzalloc(sizeof(*edev), GFP_KERNEL);
 		if (!edev) {
 			dev_err(root->dev, "EISA: Out of memory for slot %d\n",
@@ -367,8 +367,8 @@ static int __init eisa_probe(struct eisa_root_device *root)
 
 		if (eisa_request_resources(root, edev, i)) {
 			dev_warn(root->dev,
-			         "Cannot allocate resource for EISA slot %d\n",
-			         i);
+				 "Cannot allocate resource for EISA slot %d\n",
+				 i);
 			kfree(edev);
 			continue;
 		}
@@ -395,11 +395,11 @@ static int __init eisa_probe(struct eisa_root_device *root)
 
 		if (eisa_register_device(edev)) {
 			dev_err(&edev->dev, "EISA: Failed to register %s\n",
-			        edev->id.sig);
+				edev->id.sig);
 			eisa_release_resources(edev);
 			kfree(edev);
 		}
-        }
+	}
 
 	dev_info(root->dev, "EISA: Detected %d card%s\n", c, c == 1 ? "" : "s");
 	return 0;
@@ -422,7 +422,7 @@ int __init eisa_root_register(struct eisa_root_device *root)
 	 * been already registered. This prevents the virtual root
 	 * device from registering after the real one has, for
 	 * example... */
-	
+
 	root->eisa_root_res.name  = eisa_root_res.name;
 	root->eisa_root_res.start = root->res->start;
 	root->eisa_root_res.end   = root->res->end;
@@ -431,7 +431,7 @@ int __init eisa_root_register(struct eisa_root_device *root)
 	err = request_resource(&eisa_root_res, &root->eisa_root_res);
 	if (err)
 		return err;
-	
+
 	root->bus_nr = eisa_bus_count++;
 
 	err = eisa_probe(root);
@@ -444,7 +444,7 @@ int __init eisa_root_register(struct eisa_root_device *root)
 static int __init eisa_init(void)
 {
 	int r;
-	
+
 	r = bus_register(&eisa_bus_type);
 	if (r)
 		return r;
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c
index a333bf3517de..b5f367b44413 100644
--- a/drivers/eisa/pci_eisa.c
+++ b/drivers/eisa/pci_eisa.c
@@ -50,11 +50,11 @@ static int __init pci_eisa_init(struct pci_dev *pdev)
 		return -1;
 	}
 
-	pci_eisa_root.dev              = &pdev->dev;
-	pci_eisa_root.res	       = bus_res;
-	pci_eisa_root.bus_base_addr    = bus_res->start;
-	pci_eisa_root.slots	       = EISA_MAX_SLOTS;
-	pci_eisa_root.dma_mask         = pdev->dma_mask;
+	pci_eisa_root.dev		= &pdev->dev;
+	pci_eisa_root.res		= bus_res;
+	pci_eisa_root.bus_base_addr	= bus_res->start;
+	pci_eisa_root.slots		= EISA_MAX_SLOTS;
+	pci_eisa_root.dma_mask		= pdev->dma_mask;
 	dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
 
 	if (eisa_root_register (&pci_eisa_root)) {
diff --git a/drivers/eisa/virtual_root.c b/drivers/eisa/virtual_root.c
index 535e4f9c83f4..f1221c1d6319 100644
--- a/drivers/eisa/virtual_root.c
+++ b/drivers/eisa/virtual_root.c
@@ -35,11 +35,11 @@ static struct platform_device eisa_root_dev = {
 };
 
 static struct eisa_root_device eisa_bus_root = {
-	.dev           = &eisa_root_dev.dev,
-	.bus_base_addr = 0,
-	.res	       = &ioport_resource,
-	.slots	       = EISA_MAX_SLOTS,
-	.dma_mask      = 0xffffffff,
+	.dev		= &eisa_root_dev.dev,
+	.bus_base_addr	= 0,
+	.res		= &ioport_resource,
+	.slots		= EISA_MAX_SLOTS,
+	.dma_mask	= 0xffffffff,
 };
 
 static void virtual_eisa_release (struct device *dev)
@@ -50,13 +50,12 @@ static void virtual_eisa_release (struct device *dev)
 static int __init virtual_eisa_root_init (void)
 {
 	int r;
-	
-        if ((r = platform_device_register (&eisa_root_dev))) {
-                return r;
-        }
+
+	if ((r = platform_device_register (&eisa_root_dev)))
+		return r;
 
 	eisa_bus_root.force_probe = force_probe;
-	
+
 	dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
 
 	if (eisa_root_register (&eisa_bus_root)) {
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] EISA: Delete error message for a failed memory allocation in eisa_probe()
  2018-01-17  9:39 [PATCH 0/2] Minor EISA cleanup Ladislav Michl
  2018-01-17  9:44 ` [PATCH 1/2] EISA: Whitespace cleanup Ladislav Michl
@ 2018-01-17  9:45 ` Ladislav Michl
  2018-01-17 10:20 ` [PATCH 0/2] Minor EISA cleanup Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Ladislav Michl @ 2018-01-17  9:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Bjorn Helgaas, Marc Zyngier

Omit extra message for a memory allocation failure in probe function.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 drivers/eisa/eisa-bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 4155507052bd..1e8062f6dbfc 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -324,10 +324,8 @@ static int __init eisa_probe(struct eisa_root_device *root)
 	 * here, simply fail, unless root->force_probe is set. */
 
 	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
-	if (!edev) {
-		dev_err(root->dev, "EISA: Couldn't allocate mainboard slot\n");
+	if (!edev)
 		return -ENOMEM;
-	}
 
 	if (eisa_request_resources(root, edev, 0)) {
 		dev_warn(root->dev,
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Minor EISA cleanup
  2018-01-17  9:39 [PATCH 0/2] Minor EISA cleanup Ladislav Michl
  2018-01-17  9:44 ` [PATCH 1/2] EISA: Whitespace cleanup Ladislav Michl
  2018-01-17  9:45 ` [PATCH 2/2] EISA: Delete error message for a failed memory allocation in eisa_probe() Ladislav Michl
@ 2018-01-17 10:20 ` Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2018-01-17 10:20 UTC (permalink / raw)
  To: Ladislav Michl; +Cc: linux-kernel, Greg Kroah-Hartman, Bjorn Helgaas

On 2018-01-17 09:39, Ladislav Michl wrote:
> Hi,
>
> this is nothing dramatic, just whitespace cleanup and one error
> logging line deletion. Sending it as preparation for SGI Indigo2
> related patches which I'm unsure ever happens as my machine
> stopped working few days ago.
>
> Ladislav Michl (2):
>   EISA: Whitespace cleanup
>   EISA: Delete error message for a failed memory allocation in
>     eisa_probe()
>
>  drivers/eisa/eisa-bus.c     | 28 +++++++++++++---------------
>  drivers/eisa/virtual_root.c |  4 ++--
>  2 files changed, 15 insertions(+), 17 deletions(-)

Wow, a blast from the past. Careful, at the third patch, you become the 
maintainer... ;-)

My own Indigo2 is unfortunately long dead, and the only EISA machine I 
have left is an Alpha Jensen (and it hasn't been powered on in about 8 
years).

For these two patches:

Acked-by: Marc Zyngier <maz@misterjones.org>

Thanks,

         M.
-- 
Who you jivin' with that Cosmik Debris?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-17 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17  9:39 [PATCH 0/2] Minor EISA cleanup Ladislav Michl
2018-01-17  9:44 ` [PATCH 1/2] EISA: Whitespace cleanup Ladislav Michl
2018-01-17  9:45 ` [PATCH 2/2] EISA: Delete error message for a failed memory allocation in eisa_probe() Ladislav Michl
2018-01-17 10:20 ` [PATCH 0/2] Minor EISA cleanup Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox