:::::: 
:::::: Manual check reason: "low confidence static check warning: 
drivers/dax/mapping.c:83:35: warning: Parameter 'entry' can be declared with 
const [constParameter]"
:::::: 

BCC: [email protected]
CC: [email protected]
In-Reply-To: 
<166225781235.2351842.9238883139775499926.st...@dwillia2-xfh.jf.intel.com>
References: 
<166225781235.2351842.9238883139775499926.st...@dwillia2-xfh.jf.intel.com>
TO: Dan Williams <[email protected]>

Hi Dan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 1c23f9e627a7b412978b4e852793c5e3c3efc555]

url:    
https://github.com/intel-lab-lkp/linux/commits/Dan-Williams/Fix-the-DAX-gup-mistake/20220904-101909
base:   1c23f9e627a7b412978b4e852793c5e3c3efc555
:::::: branch date: 12 hours ago
:::::: commit date: 12 hours ago
compiler: nios2-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout fad43bd381f272faee26ae09d0741c48a4dbaa14
        cppcheck --quiet --enable=style,performance,portability --template=gcc 
FILE

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/dax/mapping.c:83:35: warning: Parameter 'entry' can be declared with 
>> const [constParameter]
   static bool dax_is_conflict(void *entry)
                                     ^
>> drivers/dax/mapping.c:366:71: warning: Parameter 'mapping' can be declared 
>> with const [constParameter]
   static void dax_disassociate_entry(void *entry, struct address_space 
*mapping,
                                                                         ^
--
>> mm/swap.c:623:31: warning: Using pointer that is a temporary. 
>> [danglingTemporaryLifetime]
    struct folio_batch *fbatch = &fbatches->lru_add;
                                 ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:623:31: note: Address of variable taken here.
    struct folio_batch *fbatch = &fbatches->lru_add;
                                 ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:623:31: note: Using pointer that is a temporary.
    struct folio_batch *fbatch = &fbatches->lru_add;
                                 ^
   mm/swap.c:623:32: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    struct folio_batch *fbatch = &fbatches->lru_add;
                                  ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:623:32: note: Using pointer that is a temporary.
    struct folio_batch *fbatch = &fbatches->lru_add;
                                  ^
   mm/swap.c:625:24: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    if (folio_batch_count(fbatch))
                          ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:623:31: note: Address of variable taken here.
    struct folio_batch *fbatch = &fbatches->lru_add;
                                 ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:625:24: note: Using pointer that is a temporary.
    if (folio_batch_count(fbatch))
                          ^
   mm/swap.c:630:34: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    if (data_race(folio_batch_count(fbatch))) {
                                    ^
   mm/swap.c:628:11: note: Address of variable taken here.
    fbatch = &per_cpu(lru_rotate.fbatch, cpu);
             ^
   mm/swap.c:628:19: note: Temporary created here.
    fbatch = &per_cpu(lru_rotate.fbatch, cpu);
                     ^
   mm/swap.c:630:34: note: Using pointer that is a temporary.
    if (data_race(folio_batch_count(fbatch))) {
                                    ^
   mm/swap.c:639:11: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    fbatch = &fbatches->lru_deactivate_file;
             ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:639:11: note: Address of variable taken here.
    fbatch = &fbatches->lru_deactivate_file;
             ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:639:11: note: Using pointer that is a temporary.
    fbatch = &fbatches->lru_deactivate_file;
             ^
   mm/swap.c:640:24: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    if (folio_batch_count(fbatch))
                          ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:639:11: note: Address of variable taken here.
    fbatch = &fbatches->lru_deactivate_file;
             ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:640:24: note: Using pointer that is a temporary.
    if (folio_batch_count(fbatch))
                          ^
   mm/swap.c:643:11: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    fbatch = &fbatches->lru_deactivate;
             ^
   mm/swap.c:622:34: note: Address of variable taken here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                    ^
   mm/swap.c:643:11: note: Address of variable taken here.
    fbatch = &fbatches->lru_deactivate;
             ^
   mm/swap.c:622:42: note: Temporary created here.
    struct cpu_fbatches *fbatches = &per_cpu(cpu_fbatches, cpu);
                                            ^
   mm/swap.c:643:11: note: Using pointer that is a temporary.
    fbatch = &fbatches->lru_deactivate;
             ^
   mm/swap.c:644:24: warning: Using pointer that is a temporary. 
[danglingTemporaryLifetime]
    if (folio_batch_count(fbatch))

vim +/entry +83 drivers/dax/mapping.c

fad43bd381f272 Dan Williams 2022-09-03  78  
fad43bd381f272 Dan Williams 2022-09-03  79  /*
fad43bd381f272 Dan Williams 2022-09-03  80   * true if the entry that was found 
is of a smaller order than the entry
fad43bd381f272 Dan Williams 2022-09-03  81   * we were looking for
fad43bd381f272 Dan Williams 2022-09-03  82   */
fad43bd381f272 Dan Williams 2022-09-03 @83  static bool dax_is_conflict(void 
*entry)
fad43bd381f272 Dan Williams 2022-09-03  84  {
fad43bd381f272 Dan Williams 2022-09-03  85      return entry == XA_RETRY_ENTRY;
fad43bd381f272 Dan Williams 2022-09-03  86  }
fad43bd381f272 Dan Williams 2022-09-03  87  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to