Hi Petr,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.4-rc2 next-20191008]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    
https://github.com/0day-ci/linux/commits/Petr-Mladek/livepatch-Keep-replaced-patches-until-post_patch-callback-is-called/20191003-171833
config: x86_64-randconfig-e004-201940 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <[email protected]>

All error/warnings (new ones prefixed by >>):

   lib/livepatch/test_klp_state.c: In function 'allocate_loglevel_state':
>> lib/livepatch/test_klp_state.c:41:25: error: implicit declaration of 
>> function 'kzalloc'; did you mean 'kvzalloc'? 
>> [-Werror=implicit-function-declaration]
     loglevel_state->data = kzalloc(sizeof(console_loglevel), GFP_KERNEL);
                            ^~~~~~~
                            kvzalloc
>> lib/livepatch/test_klp_state.c:41:23: warning: assignment makes pointer from 
>> integer without a cast [-Wint-conversion]
     loglevel_state->data = kzalloc(sizeof(console_loglevel), GFP_KERNEL);
                          ^
   lib/livepatch/test_klp_state.c: In function 'free_loglevel_state':
>> lib/livepatch/test_klp_state.c:85:2: error: implicit declaration of function 
>> 'kfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
     kfree(loglevel_state->data);
     ^~~~~
     kvfree
   cc1: some warnings being treated as errors
--
   lib/livepatch/test_klp_state2.c: In function 'allocate_loglevel_state':
>> lib/livepatch/test_klp_state2.c:48:25: error: implicit declaration of 
>> function 'kzalloc'; did you mean 'kvzalloc'? 
>> [-Werror=implicit-function-declaration]
     loglevel_state->data = kzalloc(sizeof(console_loglevel), GFP_KERNEL);
                            ^~~~~~~
                            kvzalloc
>> lib/livepatch/test_klp_state2.c:48:23: warning: assignment makes pointer 
>> from integer without a cast [-Wint-conversion]
     loglevel_state->data = kzalloc(sizeof(console_loglevel), GFP_KERNEL);
                          ^
   lib/livepatch/test_klp_state2.c: In function 'free_loglevel_state':
>> lib/livepatch/test_klp_state2.c:114:2: error: implicit declaration of 
>> function 'kfree'; did you mean 'kvfree'? 
>> [-Werror=implicit-function-declaration]
     kfree(loglevel_state->data);
     ^~~~~
     kvfree
   cc1: some warnings being treated as errors

vim +41 lib/livepatch/test_klp_state.c

    32  
    33  static int allocate_loglevel_state(void)
    34  {
    35          struct klp_state *loglevel_state;
    36  
    37          loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
    38          if (!loglevel_state)
    39                  return -EINVAL;
    40  
  > 41          loglevel_state->data = kzalloc(sizeof(console_loglevel), 
GFP_KERNEL);
    42          if (!loglevel_state->data)
    43                  return -ENOMEM;
    44  
    45          pr_info("%s: allocating space to store console_loglevel\n",
    46                  __func__);
    47          return 0;
    48  }
    49  
    50  static void fix_console_loglevel(void)
    51  {
    52          struct klp_state *loglevel_state;
    53  
    54          loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
    55          if (!loglevel_state)
    56                  return;
    57  
    58          pr_info("%s: fixing console_loglevel\n", __func__);
    59          *(int *)loglevel_state->data = console_loglevel;
    60          console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
    61  }
    62  
    63  static void restore_console_loglevel(void)
    64  {
    65          struct klp_state *loglevel_state;
    66  
    67          loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
    68          if (!loglevel_state)
    69                  return;
    70  
    71          pr_info("%s: restoring console_loglevel\n", __func__);
    72          console_loglevel = *(int *)loglevel_state->data;
    73  }
    74  
    75  static void free_loglevel_state(void)
    76  {
    77          struct klp_state *loglevel_state;
    78  
    79          loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
    80          if (!loglevel_state)
    81                  return;
    82  
    83          pr_info("%s: freeing space for the stored console_loglevel\n",
    84                  __func__);
  > 85          kfree(loglevel_state->data);
    86  }
    87  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to