Change Summary:
Missed a few wscheck errors
Review Request #2413 — Created Oct. 23, 2019 and submitted
Information | |
---|---|
rejohnst | |
illumos-gate | |
11862 | |
Reviewers | |
general | |
This change cleans up all the smatch, cstyle and wscheck warnings in usr/src/lib/sun_sas/, which is a plugin for libSMHBAAPI. The change also enables smatch checking for this directory, going forward.
See testing notes in the ticket:
https://www.illumos.org/issues/11862
Missed a few wscheck errors
usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c (Diff revision 2) |
---|
I'm not sure if this is relevant, but should we use something like
strnlen(hba_ptr->device_path, 1) == 1
to make this and other invocations in this file more safe?
usr/src/lib/sun_sas/common/devtree_device_disco.c (Diff revision 2) |
---|
Ah yes, ctysle! I remember thee.
usr/src/lib/sun_sas/Makefile.com (Diff revision 2) |
---|
Since you're doing all this, have you considered also removing these warning suppressions (and fixing the associated problems)?
Fixes gcc warnings and updates Makefile.com to not suppress gcc warnings
Diff: |
Revision 3 (+233 -203)
|
---|
usr/src/lib/sun_sas/common/Sun_sasFreeLibrary.c (Diff revision 3) |
---|
This is missing a void between the parentheses.
usr/src/lib/sun_sas/common/devtree_device_disco.c (Diff revision 3) |
---|
sizeof on a pointer doesn't look right.
Diff: |
Revision 4 (+236 -205)
|
---|
Added bug number "Information" section. Previous diff addressed the four comments from Andy S.
Bugs: |
|
---|
usr/src/lib/sun_sas/common/Sun_sasGetAdapterPortAttributes.c (Diff revision 4) |
---|
You only need to check the first byte:
if (hba_ptr->device_path[0] != '\0')
Diff: |
Revision 5 (+246 -215)
|
---|
usr/src/lib/sun_sas/common/Sun_sasGetAdapterName.c (Diff revision 5) |
---|
I think you need to put this check back in.
Address Andrew's latest comments
Diff: |
Revision 6 (+246 -215)
|
---|
One more change
Diff: |
Revision 7 (+250 -215)
|
---|