Patchwork [Open-FCoE,1/8] fcoemon: Ensure the response to the client is as expected

login
register
mail settings
Submitter Robert Love
Date March 5, 2013, 6:29 p.m.
Message ID <20130305182948.21625.89443.stgit@fritz>
Download mbox | patch
Permalink /patch/2/
State Accepted
Headers show

Comments

Robert Love - March 5, 2013, 6:29 p.m.
The client expects the string-ized error code to be an
'enum fcoe_status'. This patch ensures that callers pass
this type as the 'status' argument and thus provides better
type checking.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
---
 fcoemon.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/fcoemon.c b/fcoemon.c
index 13af6a9..12981f9 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -2502,7 +2502,10 @@  static void fcm_dcbd_event(char *msg, size_t len)
 	}
 }
 
-static void fcm_cli_reply(struct sock_info *r, int status)
+/*
+ * The status is interpreted by the client as an 'enum fcoe_status'.
+ */
+static void fcm_cli_reply(struct sock_info *r, enum fcoe_status status)
 {
 	char rbuf[MAX_MSGBUF];
 	snprintf(rbuf, MSG_RBUF, "%d", status);