Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Nov 2006 16:17:25 -0800 (PST)
From:      mjacob@freebsd.org
To:        freebsd-scsi@freebsd.org
Subject:   a code reduction function addition to cam_xpt
Message-ID:  <20061119161631.L44297@ns1.feral.com>

next in thread | raw e-mail | index | archive | help
There are *far* too many:

 	xpt_print_path(path);
 	printf("foo\n");

constructs. How about we just join them?

==== //depot/projects/newisp/cam/cam_xpt.c#12 - /home/FreeBSD/p4/newisp/cam/cam_xpt.c ====
@@ -63,6 +63,7 @@
  #include <cam/scsi/scsi_all.h>
  #include <cam/scsi/scsi_message.h>
  #include <cam/scsi/scsi_pass.h>
+#include <machine/stdarg.h>	/* for xpt_print below */
  #include "opt_cam.h"

  /* Datastructures internal to the xpt layer */
@@ -4160,6 +4161,16 @@
  	}
  }

+void
+xpt_print(struct cam_path *path, const char *fmt, ...)
+{
+	va_list ap;
+	xpt_print_path(path);
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
+}
+
==== //depot/projects/newisp/cam/cam_xpt.h#1 - /home/FreeBSD/p4/newisp/cam/cam_xpt.h ====
@@ -62,6 +62,7 @@
  int			xpt_path_comp(struct cam_path *path1,
  				      struct cam_path *path2);
  void			xpt_print_path(struct cam_path *path);
+void			xpt_print(struct cam_path *path, const char *fmt, ...);
  int			xpt_path_string(struct cam_path *path, char *str,
  					size_t str_len);
  path_id_t		xpt_path_path_id(struct cam_path *path);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061119161631.L44297>