lkml.org 
[lkml]   [2024]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH] x86/resctrl: Fix unneeded variable warning reported by kernel test robot
    From
    Hi Babu,

    Thank you for fixing this so promptly.

    I think the subject can just be:
    "x86/resctrl: Remove unneeded variable"

    On 1/24/2024 9:52 AM, Babu Moger wrote:
    > kernel test robot reported the following warning after the commit
    > 54e35eb8611c ("x86/resctrl: Read supported bandwidth sources from CPUID").

    This can be confusing since it implies that the patch you mention
    introduces the issue but instead the variable has been unneeded since
    the original:
    92bd5a139033 ("x86/resctrl: Add interface to write mbm_total_bytes_config")

    To help clarify you can mention this order of events and also add an
    appropriate "Fixes:" tag.

    > cocci warnings: (new ones prefixed by >>)
    >>> arch/x86/kernel/cpu/resctrl/rdtgroup.c:1621:5-8: Unneeded variable: "ret". Return " 0" on line 1655
    >
    > Fix the warning by removing the variable "ret" and returning 0 directly.

    cocci warning was spot on*. This fix is not just a change to "make a
    warning go away" but instead fixing an actual problem.
    It can just be "Remove the unneeded variable and return 0 directly".

    >
    > Reported-by: kernel test robot <lkp@intel.com>
    > Closes: https://lore.kernel.org/oe-kbuild-all/202401241810.jbd8Ipa1-lkp@intel.com/
    > Signed-off-by: Babu Moger <babu.moger@amd.com>

    Reinette

    * I'll add a private setup with the goal to catch these earlier.

    \
     
     \ /
      Last update: 2024-05-27 14:32    [W:7.049 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site