* [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
@ 2021-04-20 8:10 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-04-20 8:10 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3245 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.13/drivers
head: b09729cbbbf28ecdc61f00335684f7566eb740ec
commit: 97c62b647fcabd86fe703f9869be7dd91e685f50 [46/61] bcache: initialization of the buddy
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
^
vim +156 drivers/md/bcache/nvm-pages.c
97c62b647fcabd Jianpeng Ma 2021-04-14 144 static void init_nvm_free_space(struct bch_nvm_namespace *ns)
97c62b647fcabd Jianpeng Ma 2021-04-14 145 {
97c62b647fcabd Jianpeng Ma 2021-04-14 146 unsigned int start, end, i;
^^^^^^^^^^^^ ^
97c62b647fcabd Jianpeng Ma 2021-04-14 147 struct page *page;
97c62b647fcabd Jianpeng Ma 2021-04-14 148 long long pages;
97c62b647fcabd Jianpeng Ma 2021-04-14 149 pgoff_t pgoff_start;
97c62b647fcabd Jianpeng Ma 2021-04-14 150
97c62b647fcabd Jianpeng Ma 2021-04-14 151 bitmap_for_each_clear_region(ns->pages_bitmap, start, end, 0, ns->pages_total) {
97c62b647fcabd Jianpeng Ma 2021-04-14 152 pgoff_start = start;
97c62b647fcabd Jianpeng Ma 2021-04-14 153 pages = end - start;
97c62b647fcabd Jianpeng Ma 2021-04-14 154
97c62b647fcabd Jianpeng Ma 2021-04-14 155 while (pages) {
97c62b647fcabd Jianpeng Ma 2021-04-14 @156 for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
^^^^^^
This needs to be "int i;" for the loop to work correctly.
97c62b647fcabd Jianpeng Ma 2021-04-14 157 if ((pgoff_start % (1 << i) == 0) && (pages >= (1 << i)))
97c62b647fcabd Jianpeng Ma 2021-04-14 158 break;
97c62b647fcabd Jianpeng Ma 2021-04-14 159 }
97c62b647fcabd Jianpeng Ma 2021-04-14 160
97c62b647fcabd Jianpeng Ma 2021-04-14 161 page = nvm_vaddr_to_page(ns, nvm_pgoff_to_vaddr(ns, pgoff_start));
97c62b647fcabd Jianpeng Ma 2021-04-14 162 page->index = pgoff_start;
97c62b647fcabd Jianpeng Ma 2021-04-14 163 set_page_private(page, i);
97c62b647fcabd Jianpeng Ma 2021-04-14 164 __SetPageBuddy(page);
97c62b647fcabd Jianpeng Ma 2021-04-14 165 list_add((struct list_head *)&page->zone_device_data, &ns->free_area[i]);
97c62b647fcabd Jianpeng Ma 2021-04-14 166
97c62b647fcabd Jianpeng Ma 2021-04-14 167 pgoff_start += 1 << i;
97c62b647fcabd Jianpeng Ma 2021-04-14 168 pages -= 1 << i;
97c62b647fcabd Jianpeng Ma 2021-04-14 169 }
97c62b647fcabd Jianpeng Ma 2021-04-14 170 }
688330711e9ae3 Jianpeng Ma 2021-04-14 171 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [kbuild] [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
@ 2021-04-20 8:10 ` Dan Carpenter
0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-04-20 8:10 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3245 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.13/drivers
head: b09729cbbbf28ecdc61f00335684f7566eb740ec
commit: 97c62b647fcabd86fe703f9869be7dd91e685f50 [46/61] bcache: initialization of the buddy
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
^
vim +156 drivers/md/bcache/nvm-pages.c
97c62b647fcabd Jianpeng Ma 2021-04-14 144 static void init_nvm_free_space(struct bch_nvm_namespace *ns)
97c62b647fcabd Jianpeng Ma 2021-04-14 145 {
97c62b647fcabd Jianpeng Ma 2021-04-14 146 unsigned int start, end, i;
^^^^^^^^^^^^ ^
97c62b647fcabd Jianpeng Ma 2021-04-14 147 struct page *page;
97c62b647fcabd Jianpeng Ma 2021-04-14 148 long long pages;
97c62b647fcabd Jianpeng Ma 2021-04-14 149 pgoff_t pgoff_start;
97c62b647fcabd Jianpeng Ma 2021-04-14 150
97c62b647fcabd Jianpeng Ma 2021-04-14 151 bitmap_for_each_clear_region(ns->pages_bitmap, start, end, 0, ns->pages_total) {
97c62b647fcabd Jianpeng Ma 2021-04-14 152 pgoff_start = start;
97c62b647fcabd Jianpeng Ma 2021-04-14 153 pages = end - start;
97c62b647fcabd Jianpeng Ma 2021-04-14 154
97c62b647fcabd Jianpeng Ma 2021-04-14 155 while (pages) {
97c62b647fcabd Jianpeng Ma 2021-04-14 @156 for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
^^^^^^
This needs to be "int i;" for the loop to work correctly.
97c62b647fcabd Jianpeng Ma 2021-04-14 157 if ((pgoff_start % (1 << i) == 0) && (pages >= (1 << i)))
97c62b647fcabd Jianpeng Ma 2021-04-14 158 break;
97c62b647fcabd Jianpeng Ma 2021-04-14 159 }
97c62b647fcabd Jianpeng Ma 2021-04-14 160
97c62b647fcabd Jianpeng Ma 2021-04-14 161 page = nvm_vaddr_to_page(ns, nvm_pgoff_to_vaddr(ns, pgoff_start));
97c62b647fcabd Jianpeng Ma 2021-04-14 162 page->index = pgoff_start;
97c62b647fcabd Jianpeng Ma 2021-04-14 163 set_page_private(page, i);
97c62b647fcabd Jianpeng Ma 2021-04-14 164 __SetPageBuddy(page);
97c62b647fcabd Jianpeng Ma 2021-04-14 165 list_add((struct list_head *)&page->zone_device_data, &ns->free_area[i]);
97c62b647fcabd Jianpeng Ma 2021-04-14 166
97c62b647fcabd Jianpeng Ma 2021-04-14 167 pgoff_start += 1 << i;
97c62b647fcabd Jianpeng Ma 2021-04-14 168 pages -= 1 << i;
97c62b647fcabd Jianpeng Ma 2021-04-14 169 }
97c62b647fcabd Jianpeng Ma 2021-04-14 170 }
688330711e9ae3 Jianpeng Ma 2021-04-14 171 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kbuild] [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
2021-04-20 8:10 ` [kbuild] " Dan Carpenter
(?)
@ 2021-04-20 13:40 ` Jens Axboe
2021-04-20 14:59 ` Coly Li
-1 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2021-04-20 13:40 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
On 4/20/21 2:10 AM, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.13/drivers
> head: b09729cbbbf28ecdc61f00335684f7566eb740ec
> commit: 97c62b647fcabd86fe703f9869be7dd91e685f50 [46/61] bcache: initialization of the buddy
> compiler: microblaze-linux-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>
>>> drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
> for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
Coly, how could this ever have worked?
I'm staring to get less and less impressed with this nvm changeset, it
seems broken in various ways. Might not be a bad idea to pull it from
the next queue and give it some more time to turn into something that is
acceptable.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kbuild] [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
2021-04-20 13:40 ` Jens Axboe
@ 2021-04-20 14:59 ` Coly Li
2021-04-20 15:01 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Coly Li @ 2021-04-20 14:59 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
On 4/20/21 9:40 PM, Jens Axboe wrote:
> On 4/20/21 2:10 AM, Dan Carpenter wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.13/drivers
>> head: b09729cbbbf28ecdc61f00335684f7566eb740ec
>> commit: 97c62b647fcabd86fe703f9869be7dd91e685f50 [46/61] bcache: initialization of the buddy
>> compiler: microblaze-linux-gcc (GCC) 9.3.0
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>>
>>>> drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
>> for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
>
> Coly, how could this ever have worked?
>
> I'm staring to get less and less impressed with this nvm changeset, it
> seems broken in various ways. Might not be a bad idea to pull it from
> the next queue and give it some more time to turn into something that is
> acceptable.
>
Hi Jens,
Copied, please do.
We will prepare a more stable code base for 5.14 merge window.
Thanks.
Coly Li
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kbuild] [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
2021-04-20 14:59 ` Coly Li
@ 2021-04-20 15:01 ` Jens Axboe
0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2021-04-20 15:01 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]
On 4/20/21 8:59 AM, Coly Li wrote:
> On 4/20/21 9:40 PM, Jens Axboe wrote:
>> On 4/20/21 2:10 AM, Dan Carpenter wrote:
>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.13/drivers
>>> head: b09729cbbbf28ecdc61f00335684f7566eb740ec
>>> commit: 97c62b647fcabd86fe703f9869be7dd91e685f50 [46/61] bcache: initialization of the buddy
>>> compiler: microblaze-linux-gcc (GCC) 9.3.0
>>>
>>> If you fix the issue, kindly add following tag as appropriate
>>> Reported-by: kernel test robot <lkp@intel.com>
>>>
>>> cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>>>
>>>>> drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive]
>>> for (i = BCH_MAX_ORDER - 1; i >= 0 ; i--) {
>>
>> Coly, how could this ever have worked?
>>
>> I'm staring to get less and less impressed with this nvm changeset, it
>> seems broken in various ways. Might not be a bad idea to pull it from
>> the next queue and give it some more time to turn into something that is
>> acceptable.
>>
>
> Hi Jens,
>
> Copied, please do.
>
> We will prepare a more stable code base for 5.14 merge window.
Done.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-20 15:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 8:10 [block:for-5.13/drivers 46/61] drivers/md/bcache/nvm-pages.c:156:34: warning: Unsigned variable 'i' can't be negative so it is unnecessary to test it. [unsignedPositive] Dan Carpenter
2021-04-20 8:10 ` [kbuild] " Dan Carpenter
2021-04-20 13:40 ` Jens Axboe
2021-04-20 14:59 ` Coly Li
2021-04-20 15:01 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.