public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove unneeded indentation in drivers/char/watchdog/i8xx_tco.c
@ 2005-07-20  8:36 Rolf Eike Beer
  2005-07-21 11:52 ` Nils Faerber
  0 siblings, 1 reply; 3+ messages in thread
From: Rolf Eike Beer @ 2005-07-20  8:36 UTC (permalink / raw)
  To: Nils Faerber; +Cc: Linux Kernel Mailing List

Hi,

this patch changes a bit of indentation. Currently it is

if (i8xx_tcp_pci) {
...
	return 1;
}
return 0;

Now it will be

if (!i8xx_tcp_pci)
	return 0;
...
return 1;

Also some superfluous spaces are killed to match Codingstyle.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>

--- linux-2.6.13-rc3/drivers/char/watchdog/i8xx_tco.c	2005-07-13 06:46:46.000000000 +0200
+++ linux-2.6.13-rc3-eike/drivers/char/watchdog/i8xx_tco.c	2005-07-20 10:22:18.000000000 +0200
@@ -391,7 +391,7 @@ MODULE_DEVICE_TABLE (pci, i8xx_tco_pci_t
  *	Init & exit routines
  */
 
-static unsigned char __init i8xx_tco_getdevice (void)
+static unsigned char __init i8xx_tco_getdevice(void)
 {
 	struct pci_dev *dev = NULL;
 	u8 val1, val2;
@@ -407,47 +407,47 @@ static unsigned char __init i8xx_tco_get
 		}
 	}
 
-	if (i8xx_tco_pci) {
-		/*
-		 *      Find the ACPI base I/O address which is the base
-		 *      for the TCO registers (TCOBASE=ACPIBASE + 0x60)
-		 *      ACPIBASE is bits [15:7] from 0x40-0x43
-		 */
-		pci_read_config_byte (i8xx_tco_pci, 0x40, &val1);
-		pci_read_config_byte (i8xx_tco_pci, 0x41, &val2);
-		badr = ((val2 << 1) | (val1 >> 7)) << 7;
-		ACPIBASE = badr;
-		/* Something's wrong here, ACPIBASE has to be set */
-		if (badr == 0x0001 || badr == 0x0000) {
-			printk (KERN_ERR PFX "failed to get TCOBASE address\n");
-			return 0;
-		}
-		/*
-		 * Check chipset's NO_REBOOT bit
-		 */
+	if (!i8xx_tco_pci)
+		return 0;
+
+	/*
+	 *      Find the ACPI base I/O address which is the base
+	 *      for the TCO registers (TCOBASE=ACPIBASE + 0x60)
+	 *      ACPIBASE is bits [15:7] from 0x40-0x43
+	 */
+	pci_read_config_byte(i8xx_tco_pci, 0x40, &val1);
+	pci_read_config_byte(i8xx_tco_pci, 0x41, &val2);
+	badr = ((val2 << 1) | (val1 >> 7)) << 7;
+	ACPIBASE = badr;
+	/* Something's wrong here, ACPIBASE has to be set */
+	if (badr == 0x0001 || badr == 0x0000) {
+		printk(KERN_ERR PFX "failed to get TCOBASE address\n");
+		return 0;
+	}
+	/*
+	 * Check chipset's NO_REBOOT bit
+	 */
+	pci_read_config_byte(i8xx_tco_pci, 0xd4, &val1);
+	if (val1 & 0x02) {
+		val1 &= 0xfd;
+		pci_write_config_byte(i8xx_tco_pci, 0xd4, val1);
 		pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);
 		if (val1 & 0x02) {
-			val1 &= 0xfd;
-			pci_write_config_byte (i8xx_tco_pci, 0xd4, val1);
-			pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);
-			if (val1 & 0x02) {
-				printk (KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
-				return 0;	/* Cannot reset NO_REBOOT bit */
-			}
-		}
-		/* Set the TCO_EN bit in SMI_EN register */
-		if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) {
-			printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-				SMI_EN + 1);
-			return 0;
+			printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
+			return 0;	/* Cannot reset NO_REBOOT bit */
 		}
-		val1 = inb (SMI_EN + 1);
-		val1 &= 0xdf;
-		outb (val1, SMI_EN + 1);
-		release_region (SMI_EN + 1, 1);
-		return 1;
 	}
-	return 0;
+	/* Set the TCO_EN bit in SMI_EN register */
+	if (!request_region(SMI_EN + 1, 1, "i8xx TCO")) {
+		printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+			SMI_EN + 1);
+		return 0;
+	}
+	val1 = inb(SMI_EN + 1);
+	val1 &= 0xdf;
+	outb(val1, SMI_EN + 1);
+	release_region(SMI_EN + 1, 1);
+	return 1;
 }
 
 static int __init watchdog_init (void)

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

* Re: [PATCH] remove unneeded indentation in drivers/char/watchdog/i8xx_tco.c
  2005-07-20  8:36 [PATCH] remove unneeded indentation in drivers/char/watchdog/i8xx_tco.c Rolf Eike Beer
@ 2005-07-21 11:52 ` Nils Faerber
  2005-07-21 12:19   ` Rolf Eike Beer
  0 siblings, 1 reply; 3+ messages in thread
From: Nils Faerber @ 2005-07-21 11:52 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: Nils Faerber, Linux Kernel Mailing List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rolf Eike Beer schrieb:
> Hi,
hi!

> this patch changes a bit of indentation. Currently it is
> if (i8xx_tcp_pci) {
> .....
> 	return 1;
> }
> return 0;
> 
> Now it will be
> 
> if (!i8xx_tcp_pci)
> 	return 0;
> .....
> return 1;
> 
> Also some superfluous spaces are killed to match Codingstyle

Don't know who added those strange things ;)
But looks OK to me to change it this way.

So please go ahead and forward this patch.

Many thanks!

  nils

- --
kernel concepts          Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          Mob: +49-176-21024535
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC34x7JXeIURG1qHgRAs8HAKCHYD34TC3eDTGMQUnj4yrYM735bwCgkOAq
8kJdpgtczkWQd+MA+t7MxA0=
=JDJC
-----END PGP SIGNATURE-----

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

* Re: [PATCH] remove unneeded indentation in drivers/char/watchdog/i8xx_tco.c
  2005-07-21 11:52 ` Nils Faerber
@ 2005-07-21 12:19   ` Rolf Eike Beer
  0 siblings, 0 replies; 3+ messages in thread
From: Rolf Eike Beer @ 2005-07-21 12:19 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Nils Faerber, Linus Torvalds, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

Nils Faerber wrote:
>Rolf Eike Beer schrieb:

>> this patch changes a bit of indentation. Currently it is
>> [...]
>> Also some superfluous spaces are killed to match Codingstyle
>
>Don't know who added those strange things ;)
>But looks OK to me to change it this way.
>
>So please go ahead and forward this patch.

In this case add a Signed-off-by.

Eike

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2005-07-21 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-20  8:36 [PATCH] remove unneeded indentation in drivers/char/watchdog/i8xx_tco.c Rolf Eike Beer
2005-07-21 11:52 ` Nils Faerber
2005-07-21 12:19   ` Rolf Eike Beer

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