Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10223c60 authored by Martin Peschke's avatar Martin Peschke Committed by James Bottomley
Browse files

[SCSI] zfcp: Introduce printf helper functions for debug trace.



Introducing helper functions that allow for code simpfifications.

Signed-off-by: default avatarMartin Peschke <mp3@de.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent b75db731
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -95,6 +95,22 @@ zfcp_dbf_view(char *out_buf, const char *label, const char *format, ...)
	return len;
}

static void zfcp_dbf_outs(char **buf, const char *s1, const char *s2)
{
	*buf += sprintf(*buf, "%-24s%s\n", s1, s2);
}

static void zfcp_dbf_out(char **buf, const char *s, const char *format, ...)
{
	va_list arg;

	*buf += sprintf(*buf, "%-24s", s);
	va_start(arg, format);
	*buf += vsprintf(*buf, format, arg);
	va_end(arg);
	*buf += sprintf(*buf, "\n");
}

static int
zfcp_dbf_view_dump(char *out_buf, const char *label,
		   char *buffer, int buflen, int offset, int total_size)