library: more tweaks for code and/or comments, 3rd gen
Following is a summary of significant changes (if any) to each of these now upgraded 3rd gen library modules. <meminfo> ............................................ . eliminated duplicate decl of 'struct procps_meminfo' . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . how did i miss relocating all these friggin' #undefs . cleanup 'get' return logic (remove a redundant 'if') <pids> ............................................... . repositioned the procps_pidsinfo structure in header . removed the extra trailing comma from enum pids_item . standardized/normalized results struct union members <slabinfo> ........................................... . corrected comment typo (jeeze, in an 'aligned' para) . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . removed an obsolete #undef from procps_slabinfo_sort . cleanup 'get' return logic (remove a redundant 'if') <stat> ............................................... . how did i miss relocating all these friggin' #undefs . corrected an initialization fencepost used with numa <=== see Craig, here's a bug fix . removed the extra trailing comma from enum stat_item . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . strengthen those parm checks in procps_stat_get func . cleanup 'get' return logic (remove a redundant 'if') <vmstat> ............................................. . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . cleanup 'get' return logic (remove a redundant 'if') [ virtually all of these tweaks reflect the author's ] [ continuing pursuit of an unreasonable goal -- that ] [ of a 'perfect' (plus 'pretty') C language program! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@ -1358,6 +1358,8 @@ static struct stacks_extent *stacks_alloc (
|
||||
|
||||
// ___ Public Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
// --- standard required functions --------------------------------------------
|
||||
|
||||
/*
|
||||
* procps_vmstat_new:
|
||||
*
|
||||
@ -1424,6 +1426,8 @@ PROCPS_EXPORT int procps_vmstat_unref (
|
||||
} // end: procps_vmstat_unref
|
||||
|
||||
|
||||
// --- variable interface functions -------------------------------------------
|
||||
|
||||
PROCPS_EXPORT signed long procps_vmstat_get (
|
||||
struct procps_vmstat *info,
|
||||
enum vmstat_item item)
|
||||
@ -1446,9 +1450,7 @@ PROCPS_EXPORT signed long procps_vmstat_get (
|
||||
sav_secs = cur_secs;
|
||||
}
|
||||
|
||||
if (item < PROCPS_VMSTAT_logical_end)
|
||||
return Item_table[item].getsfunc(info);
|
||||
return -EINVAL;
|
||||
return Item_table[item].getsfunc(info);
|
||||
} // end: procps_vmstat_get
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user