lparcfg.c comments
Julie DeWandel
jdewand at redhat.com
Tue Mar 2 08:15:11 EST 2004
I was merging the SPLPAR changes for lparcfg.c into our version of the
code when I noticed a few things. Here they are:
Bug:
* parse_system_parameter_string kmallocs some buffers
("local_buffer", "workbuffer") but kmalloc could fail and return
a NULL. The code needs to check for this rather than to
potentially reference a null pointer.
Suggestions:
* h_get_ppp, h_pic, and h_purr are declared as returning an unsigned
int. However, these functions always return 0 and that value is
never checked by the caller. Suggest declaring them as returning a
void.
* h_get_ppp, h_pic, h_purr, and parse_system_parameter_string aren't
called from elsewhere. Suggest making them static.
* parse_system_parameter_string declares things like "workbuffer",
"idx", "w_idx" in the middle of the code which isn't appreciated
by the compiler. Suggest declaring them at the top of the function
or top of the code block they are used within.
* both lparcfg.c and viopath.c declare the same function: e2a.
Suggest making one of them non-static (the one in viopath.c) and
eliminating the one from lparcfg.c.
Thanks,
Julie
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list