fcm_port_create will execute an action if the port already existed. This is confusing so add a comment.
Signed-off-by: Robert Love <[email protected]> --- fcoemon.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/fcoemon.c b/fcoemon.c index e0903ce..92eba5b 100644 --- a/fcoemon.c +++ b/fcoemon.c @@ -2308,6 +2308,11 @@ static void fcm_pidfile_create(void) } } +/* + * TODO: This routine does too much. It executes a 'cmd' + * and allocates a fcoe_port if one doesn't exist. The + * function name implies that it only does the latter. + */ static struct fcoe_port *fcm_port_create(char *ifname, int cmd) { struct fcoe_port *p; @@ -2385,6 +2390,15 @@ static enum fcoe_status fcm_cli_create(char *ifname, int cmd, vp = fcm_find_next_fcoe_port(vp, p->ifname); } } + + /* + * This looks odd, and could use some improvement. We may + * or may not have found a valid port. fcm_port_create + * will execute the 'cmd' even if it doesn't allocate a + * new port. fcm_port_create should probably be split + * into two routines, one that allocs a new port and one + * that executes the command. + */ p = fcm_port_create(ifname, cmd); if (!p) return EFAIL; _______________________________________________ devel mailing list [email protected] https://lists.open-fcoe.org/mailman/listinfo/devel
