msgbuf: Relax requirements on pointer out-parameters

The span and peek msgbuf APIs tended to require that the value of the
'cursor' out-parameter was set to NULL at the point of the call. This is
a pedantic restriction that's unnecessary for msgbuf or any other
internal APIs. The pattern was copied from the public APIs, where in
some cases the struct types were publicly declared but not publicly
defined in order to hide implementation details, but the APIs were
designed to allow for future changes exposing the struct definitions so
the objects could be stack-allocated.

Change-Id: I8c96b8b4b3515c2a9719e9df8b2f068d753dbba6
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/msgbuf.h b/src/msgbuf.h
index 6000724..f953981 100644
--- a/src/msgbuf.h
+++ b/src/msgbuf.h
@@ -962,7 +962,7 @@
 						       size_t required,
 						       void **cursor)
 {
-	if (!ctx->cursor || (cursor && *cursor)) {
+	if (!ctx->cursor) {
 		return -EINVAL;
 	}
 
@@ -995,7 +995,7 @@
 {
 	intmax_t measured;
 
-	if (!ctx->cursor || (cursor && *cursor)) {
+	if (!ctx->cursor) {
 		return -EINVAL;
 	}
 
@@ -1050,7 +1050,7 @@
 	ptrdiff_t measured;
 	void *end;
 
-	if (!ctx->cursor || (cursor && *cursor)) {
+	if (!ctx->cursor) {
 		return -EINVAL;
 	}
 
@@ -1123,7 +1123,7 @@
 LIBPLDM_CC_ALWAYS_INLINE int
 pldm_msgbuf_span_remaining(struct pldm_msgbuf *ctx, void **cursor, size_t *len)
 {
-	if (!ctx->cursor || *cursor) {
+	if (!ctx->cursor) {
 		return -EINVAL;
 	}
 
@@ -1143,7 +1143,7 @@
 LIBPLDM_CC_ALWAYS_INLINE int
 pldm_msgbuf_peek_remaining(struct pldm_msgbuf *ctx, void **cursor, size_t *len)
 {
-	if (!ctx->cursor || *cursor) {
+	if (!ctx->cursor) {
 		return -EINVAL;
 	}