Skip to content

Commit 7f33df9

Browse files
Sergey Shtylyovhdeller
authored andcommitted
fbdev: core: cfbcopyarea: fix sloppy typing
In cfb_copyarea(), the local variable bits_per_line is needlessly typed as *unsigned long* -- which is a 32-bit type on the 32-bit arches and a 64-bit type on the 64-bit arches; that variable's value is derived from the __u32 typed fb_fix_screeninfo::line_length field (multiplied by 8u) and a 32-bit *unsigned int* type should still be enough to store the # of bits per line. Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 1022e7e commit 7f33df9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/core/cfbcopyarea.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
382382
{
383383
u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;
384384
u32 height = area->height, width = area->width;
385-
unsigned long const bits_per_line = p->fix.line_length*8u;
385+
unsigned int const bits_per_line = p->fix.line_length * 8u;
386386
unsigned long __iomem *base = NULL;
387387
int bits = BITS_PER_LONG, bytes = bits >> 3;
388388
unsigned dst_idx = 0, src_idx = 0, rev_copy = 0;

0 commit comments

Comments
 (0)