Allow print_reg() to be called with a NULL column.
authorPeter Avalos <pavalos@dragonflybsd.org>
Fri, 6 Jul 2007 23:44:54 +0000 (23:44 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Fri, 6 Jul 2007 23:44:54 +0000 (23:44 +0000)
Obtained-from: FreeBSD

sys/dev/disk/aic7xxx/aic79xx.c
sys/dev/disk/aic7xxx/aic7xxx.c

index d2561ba..77416a3 100644 (file)
@@ -39,8 +39,8 @@
  *
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#246 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.35 2005/02/16 18:09:41 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.25 2007/07/06 06:26:59 pavalos Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.36 2005/02/16 23:13:38 gibbs Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.26 2007/07/06 23:44:54 pavalos Exp $
  */
 
 #include "aic79xx_osm.h"
@@ -8880,6 +8880,12 @@ ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries,
 {
        int     printed;
        u_int   printed_mask;
+       u_int   dummy_column;
+
+       if (cur_column == NULL) {
+               dummy_column = 0;
+               cur_column = &dummy_column;
+       }
 
        if (cur_column != NULL && *cur_column >= wrap_point) {
                kprintf("\n");
@@ -8916,8 +8922,7 @@ ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries,
                printed += kprintf(") ");
        else
                printed += kprintf(" ");
-       if (cur_column != NULL)
-               *cur_column += printed;
+       *cur_column += printed;
        return (printed);
 }
 
index a788230..8df2645 100644 (file)
@@ -39,8 +39,8 @@
  *
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.107 2005/02/16 18:09:41 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.23 2007/07/06 06:27:00 pavalos Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.108 2005/02/16 23:13:38 gibbs Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.24 2007/07/06 23:44:54 pavalos Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -6672,6 +6672,12 @@ ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries,
 {
        int     printed;
        u_int   printed_mask;
+       u_int   dummy_column;
+
+       if (cur_column == NULL) {
+               dummy_column = 0;
+               cur_column = &dummy_column;
+       }
 
        if (cur_column != NULL && *cur_column >= wrap_point) {
                kprintf("\n");