hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/video/fbdev/tgafb.c
....@@ -70,7 +70,7 @@
7070 * Frame buffer operations
7171 */
7272
73
-static struct fb_ops tgafb_ops = {
73
+static const struct fb_ops tgafb_ops = {
7474 .owner = THIS_MODULE,
7575 .fb_check_var = tgafb_check_var,
7676 .fb_set_par = tgafb_set_par,
....@@ -989,8 +989,10 @@
989989 /* We can fill 2k pixels per operation. Notice blocks that fit
990990 the width of the screen so that we can take advantage of this
991991 and fill more than one line per write. */
992
- if (width == line_length)
993
- width *= height, height = 1;
992
+ if (width == line_length) {
993
+ width *= height;
994
+ height = 1;
995
+ }
994996
995997 /* The write into the frame buffer must be aligned to 4 bytes,
996998 but we are allowed to encode the offset within the word in
....@@ -1171,8 +1173,10 @@
11711173 More than anything else, these control how we do copies. */
11721174 depos = dy * line_length + dx;
11731175 sepos = sy * line_length + sx;
1174
- if (backward)
1175
- depos += width, sepos += width;
1176
+ if (backward) {
1177
+ depos += width;
1178
+ sepos += width;
1179
+ }
11761180
11771181 /* Next copy full words at a time. */
11781182 n32 = width / 32;
....@@ -1416,10 +1420,8 @@
14161420
14171421 /* Allocate the fb and par structures. */
14181422 info = framebuffer_alloc(sizeof(struct tga_par), dev);
1419
- if (!info) {
1420
- printk(KERN_ERR "tgafb: Cannot allocate memory\n");
1423
+ if (!info)
14211424 return -ENOMEM;
1422
- }
14231425
14241426 par = info->par;
14251427 dev_set_drvdata(dev, info);
....@@ -1440,7 +1442,7 @@
14401442 }
14411443
14421444 /* Map the framebuffer. */
1443
- mem_base = ioremap_nocache(bar0_start, bar0_len);
1445
+ mem_base = ioremap(bar0_start, bar0_len);
14441446 if (!mem_base) {
14451447 printk(KERN_ERR "tgafb: Cannot map MMIO\n");
14461448 goto err1;