Babu Moger 527f721478 x86/resctrl: Fix a maybe-uninitialized build warning treated as error
The recent commit

  064855a69003 ("x86/resctrl: Fix default monitoring groups reporting")

caused a RHEL build failure with an uninitialized variable warning
treated as an error because it removed the default case snippet.

The RHEL Makefile uses '-Werror=maybe-uninitialized' to force possibly
uninitialized variable warnings to be treated as errors. This is also
reported by smatch via the 0day robot.

The error from the RHEL build is:

  arch/x86/kernel/cpu/resctrl/monitor.c: In function ‘__mon_event_count’:
  arch/x86/kernel/cpu/resctrl/monitor.c:261:12: error: ‘m’ may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
    m->chunks += chunks;
              ^~

The upstream Makefile does not build using '-Werror=maybe-uninitialized'.
So, the problem is not seen there. Fix the problem by putting back the
default case snippet.

 [ bp: note that there's nothing wrong with the code and other compilers
   do not trigger this warning - this is being done just so the RHEL compiler
   is happy. ]

Fixes: 064855a69003 ("x86/resctrl: Fix default monitoring groups reporting")
Reported-by: Terry Bowman <Terry.Bowman@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/162949631908.23903.17090272726012848523.stgit@bmoger-ubuntu
2021-08-22 09:11:29 +02:00
..
2021-06-29 13:39:41 -07:00
2021-06-07 11:02:30 +02:00
2020-11-24 16:47:49 +01:00
2021-04-26 15:10:25 -07:00
2021-03-15 16:24:59 +01:00
2021-06-29 12:36:59 -07:00
2021-03-18 15:31:53 +01:00
2021-03-18 15:31:53 +01:00
2021-06-25 19:57:01 -04:00
2021-03-18 15:31:53 +01:00
2021-06-28 12:46:30 -07:00
2020-08-20 13:12:58 +02:00
2021-03-18 15:31:53 +01:00
2021-03-18 15:31:53 +01:00
2020-08-04 14:47:45 -07:00