Hi, Babu,
On Fri, Mar 12, 2021 at 01:08:31PM -0600, Babu Moger wrote:
From: Fenghua Yu fenghua.yu@intel.com Taking a closer look at the usage of these variables reveals that these variables are used only locally to functions such as cqm_resctrl_val()
%s/ locally to functions/locally in two functions
OK. Will change it.
-int get_cbm_mask(char *cache_type) +int get_cbm_mask(char *cache_type, char *cbm_mask) { char cbm_mask_path[1024]; FILE *fp;
- if (!cbm_mask)
return -1;
Can cbm_mask be NULL? I see it is statically allocated. Or should this be if (!(*cbm_mask))? Or did I miss something.
This is a sanity checking. Although current callers do pass statically allocated cbm_mask to the parameter, future callers may incorrectly pass un-allocated cbm_mask to the parameter and may cause segmentation fault without the sanity checking. To debug this kind of issue, the sanity checking will be very helpful.
So I would keep this sanity checking.
Thanks.
-Fenghua