Patchwork [v2] ioport: Improve error output

login
register
mail settings
Submitter Andreas Färber
Date March 6, 2011, 2:48 p.m.
Message ID <1299422893-32855-1-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/85579/
State New
Headers show

Comments

Andreas Färber - March 6, 2011, 2:48 p.m.
When failing due to conflicting I/O port registrations,
include the offending I/O port address in the message.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 v2:
 * Use "for address 0x%x" wording, as suggested by Aurelien.
 
 ioport.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Aurelien Jarno - March 6, 2011, 8:02 p.m.
On Sun, Mar 06, 2011 at 03:48:13PM +0100, Andreas Färber wrote:
> When failing due to conflicting I/O port registrations,
> include the offending I/O port address in the message.
> 
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
>  v2:
>  * Use "for address 0x%x" wording, as suggested by Aurelien.
>  
>  ioport.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)

Thanks, applied.

> diff --git a/ioport.c b/ioport.c
> index aa4188a..2e971fa 100644
> --- a/ioport.c
> +++ b/ioport.c
> @@ -149,7 +149,8 @@ int register_ioport_read(pio_addr_t start, int length, int size,
>      for(i = start; i < start + length; i += size) {
>          ioport_read_table[bsize][i] = func;
>          if (ioport_opaque[i] != NULL && ioport_opaque[i] != opaque)
> -            hw_error("register_ioport_read: invalid opaque");
> +            hw_error("register_ioport_read: invalid opaque for address 0x%x",
> +                     i);
>          ioport_opaque[i] = opaque;
>      }
>      return 0;
> @@ -168,7 +169,8 @@ int register_ioport_write(pio_addr_t start, int length, int size,
>      for(i = start; i < start + length; i += size) {
>          ioport_write_table[bsize][i] = func;
>          if (ioport_opaque[i] != NULL && ioport_opaque[i] != opaque)
> -            hw_error("register_ioport_write: invalid opaque");
> +            hw_error("register_ioport_write: invalid opaque for address 0x%x",
> +                     i);
>          ioport_opaque[i] = opaque;
>      }
>      return 0;
> -- 
> 1.7.3.4
> 
> 
>

Patch

diff --git a/ioport.c b/ioport.c
index aa4188a..2e971fa 100644
--- a/ioport.c
+++ b/ioport.c
@@ -149,7 +149,8 @@  int register_ioport_read(pio_addr_t start, int length, int size,
     for(i = start; i < start + length; i += size) {
         ioport_read_table[bsize][i] = func;
         if (ioport_opaque[i] != NULL && ioport_opaque[i] != opaque)
-            hw_error("register_ioport_read: invalid opaque");
+            hw_error("register_ioport_read: invalid opaque for address 0x%x",
+                     i);
         ioport_opaque[i] = opaque;
     }
     return 0;
@@ -168,7 +169,8 @@  int register_ioport_write(pio_addr_t start, int length, int size,
     for(i = start; i < start + length; i += size) {
         ioport_write_table[bsize][i] = func;
         if (ioport_opaque[i] != NULL && ioport_opaque[i] != opaque)
-            hw_error("register_ioport_write: invalid opaque");
+            hw_error("register_ioport_write: invalid opaque for address 0x%x",
+                     i);
         ioport_opaque[i] = opaque;
     }
     return 0;