Patchwork 6300ESB early smbus cleanup

login
register
about
Submitter Jonathan A. Kollasch
Date 2010-10-18 15:25:31
Message ID <20101018152531.GE1206@tarantulon.kollasch.net>
Download mbox | patch
Permalink /patch/2136/
State New
Headers show

Comments

Jonathan A. Kollasch - 2010-10-18 15:25:31
Remove unused variables from 6300ESB smbus_write_block().

#if 0 smbus_write_byte() and smbus_write_block() as they are
static and nothing uses them or are incompletely implemented.

Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
---
Peter Stuge - 2010-10-18 19:17:06
Jonathan A. Kollasch wrote:
> Remove unused variables from 6300ESB smbus_write_block().
> 
> #if 0 smbus_write_byte() and smbus_write_block() as they are
> static and nothing uses them or are incompletely implemented.

Why #if 0 rather than just removing the code completely? I think this
is a piece of code which can already be found other places if a
reference is needed?

> Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>

Acked-by: Peter Stuge <peter@stuge.se>
Stefan Reinauer - 2010-10-19 02:14:21
On 18.10.2010, at 12:17, Peter Stuge <peter@stuge.se> wrote:

> Jonathan A. Kollasch wrote:
>> Remove unused variables from 6300ESB smbus_write_block().
>> 
>> #if 0 smbus_write_byte() and smbus_write_block() as they are
>> static and nothing uses them or are incompletely implemented.
> 
> Why #if 0 rather than just removing the code completely? I think this
> is a piece of code which can already be found other places if a
> reference is needed?

Maybe use #ifdef DEADCODE if you want to leave it in. That will make it easier to recognize that the code was considered for dropping once before.


> 
>> Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
> 
> Acked-by: Peter Stuge <peter@stuge.se>
> 
> -- 
> coreboot mailing list: coreboot@coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
>
Jonathan A. Kollasch - 2010-10-19 13:54:34
On Mon, Oct 18, 2010 at 03:25:31PM +0000, Jonathan A. Kollasch wrote:
> Remove unused variables from 6300ESB smbus_write_block().
> 
> #if 0 smbus_write_byte() and smbus_write_block() as they are
> static and nothing uses them or are incompletely implemented.
> 
> Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
> ---

r5972

Patch

Index: src/southbridge/intel/esb6300/esb6300_early_smbus.c
===================================================================
--- src/southbridge/intel/esb6300/esb6300_early_smbus.c	(revision 5965)
+++ src/southbridge/intel/esb6300/esb6300_early_smbus.c	(working copy)
@@ -22,6 +22,7 @@ 
 	return do_smbus_read_byte(SMBUS_IO_BASE, device, address);
 }
 
+#if 0
 static void smbus_write_byte(unsigned device, unsigned address, unsigned char val)
 {
 	if (smbus_wait_until_ready(SMBUS_IO_BASE) < 0) {
@@ -33,8 +34,6 @@ 
 static int smbus_write_block(unsigned device, unsigned length, unsigned cmd,
 		 unsigned data1, unsigned data2)
 {
-	unsigned char global_control_register;
-	unsigned char global_status_register;
 	unsigned char byte;
 	unsigned char stat;
 	int i;
@@ -95,4 +94,5 @@ 
 	print_debug("SMBUS Block complete\n");
 	return 0;
 }
+#endif