lkml.org 
[lkml]   [2020]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/gpu/drm/nouveau/nouveau_bo0039.c:59:13: warning: Variable 'page_count' is reassigned a value before the old one has been used.
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7b4ea9456dd3f73238408126ab00f1d906963d81
commit: 8b9d5d63a7193156b6b397c4f5078efbc200695f drm/nouveau/bo: split buffer move functions into their own source files
date: 2 weeks ago
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/nouveau/nouveau_bo0039.c:59:13: warning: Variable 'page_count' is reassigned a value before the old one has been used. [redundantAssignment]
page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo0039.c:48:0: note: Variable 'page_count' is reassigned a value before the old one has been used.
u32 page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo0039.c:59:13: note: Variable 'page_count' is reassigned a value before the old one has been used.
page_count = new_reg->num_pages;
^
--
>> drivers/gpu/drm/nouveau/nouveau_bo85b5.c:47:13: warning: Variable 'page_count' is reassigned a value before the old one has been used. [redundantAssignment]
page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo85b5.c:44:0: note: Variable 'page_count' is reassigned a value before the old one has been used.
u32 page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo85b5.c:47:13: note: Variable 'page_count' is reassigned a value before the old one has been used.
page_count = new_reg->num_pages;
^
>> drivers/gpu/drm/nouveau/nouveau_bo9039.c:43:13: warning: Variable 'page_count' is reassigned a value before the old one has been used. [redundantAssignment]
page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo9039.c:40:0: note: Variable 'page_count' is reassigned a value before the old one has been used.
u32 page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo9039.c:43:13: note: Variable 'page_count' is reassigned a value before the old one has been used.
page_count = new_reg->num_pages;
^
>> drivers/gpu/drm/nouveau/nouveau_bo90b5.c:40:13: warning: Variable 'page_count' is reassigned a value before the old one has been used. [redundantAssignment]
page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo90b5.c:37:0: note: Variable 'page_count' is reassigned a value before the old one has been used.
u32 page_count = new_reg->num_pages;
^
drivers/gpu/drm/nouveau/nouveau_bo90b5.c:40:13: note: Variable 'page_count' is reassigned a value before the old one has been used.
page_count = new_reg->num_pages;
^

vim +/page_count +59 drivers/gpu/drm/nouveau/nouveau_bo0039.c

41
42 int
43 nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
44 struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg)
45 {
46 u32 src_offset = old_reg->start << PAGE_SHIFT;
47 u32 dst_offset = new_reg->start << PAGE_SHIFT;
48 u32 page_count = new_reg->num_pages;
49 int ret;
50
51 ret = RING_SPACE(chan, 3);
52 if (ret)
53 return ret;
54
55 BEGIN_NV04(chan, NvSubCopy, NV_MEMORY_TO_MEMORY_FORMAT_DMA_SOURCE, 2);
56 OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, old_reg));
57 OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, new_reg));
58
> 59 page_count = new_reg->num_pages;
60 while (page_count) {
61 int line_count = (page_count > 2047) ? 2047 : page_count;
62
63 ret = RING_SPACE(chan, 11);
64 if (ret)
65 return ret;
66
67 BEGIN_NV04(chan, NvSubCopy,
68 NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
69 OUT_RING (chan, src_offset);
70 OUT_RING (chan, dst_offset);
71 OUT_RING (chan, PAGE_SIZE); /* src_pitch */
72 OUT_RING (chan, PAGE_SIZE); /* dst_pitch */
73 OUT_RING (chan, PAGE_SIZE); /* line_length */
74 OUT_RING (chan, line_count);
75 OUT_RING (chan, 0x00000101);
76 OUT_RING (chan, 0x00000000);
77 BEGIN_NV04(chan, NvSubCopy, NV_MEMORY_TO_MEMORY_FORMAT_NOP, 1);
78 OUT_RING (chan, 0);
79
80 page_count -= line_count;
81 src_offset += (PAGE_SIZE * line_count);
82 dst_offset += (PAGE_SIZE * line_count);
83 }
84
85 return 0;
86 }
87

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

\
 
 \ /
  Last update: 2020-08-07 02:54    [W:0.027 / U:2.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site