Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8feae09 authored by Joe Perches's avatar Joe Perches Committed by Bartlomiej Zolnierkiewicz
Browse files

uvesafb: Fix continuation printks without KERN_LEVEL to pr_cont, neatening



Linus recently broke the printk without KERN_CONT behavior.
Fix it for uvesafb.

While there, convert printk(KERN_<LEVEL> to pr_<level>.
Add pr_fmt and remove the embedded prefixes.

Miscellanea:

o Coalesce formats and realign arguments
o Add a missing space to a format when coalescing.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Michal Januszewski <spock@gentoo.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 0e25884b
Loading
Loading
Loading
Loading
+62 −86
Original line number Original line Diff line number Diff line
@@ -5,6 +5,9 @@
 *     Loosely based upon the vesafb driver.
 *     Loosely based upon the vesafb driver.
 *
 *
 */
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/init.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/moduleparam.h>
@@ -149,8 +152,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
	 * allowed by connector.
	 * allowed by connector.
	 */
	 */
	if (sizeof(*m) + len > CONNECTOR_MAX_MSG_SIZE) {
	if (sizeof(*m) + len > CONNECTOR_MAX_MSG_SIZE) {
		printk(KERN_WARNING "uvesafb: message too long (%d), "
		pr_warn("message too long (%d), can't execute task\n",
			"can't execute task\n", (int)(sizeof(*m) + len));
			(int)(sizeof(*m) + len));
		return -E2BIG;
		return -E2BIG;
	}
	}


@@ -198,10 +201,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
		 */
		 */
		err = uvesafb_helper_start();
		err = uvesafb_helper_start();
		if (err) {
		if (err) {
			printk(KERN_ERR "uvesafb: failed to execute %s\n",
			pr_err("failed to execute %s\n", v86d_path);
					v86d_path);
			pr_err("make sure that the v86d helper is installed and executable\n");
			printk(KERN_ERR "uvesafb: make sure that the v86d "
					"helper is installed and executable\n");
		} else {
		} else {
			v86d_started = 1;
			v86d_started = 1;
			err = cn_netlink_send(m, 0, 0, gfp_any());
			err = cn_netlink_send(m, 0, 0, gfp_any());
@@ -375,8 +376,7 @@ static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par)
	err = uvesafb_exec(task);
	err = uvesafb_exec(task);


	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
		printk(KERN_WARNING "uvesafb: VBE get state call "
		pr_warn("VBE get state call failed (eax=0x%x, err=%d)\n",
				"failed (eax=0x%x, err=%d)\n",
			task->t.regs.eax, err);
			task->t.regs.eax, err);
		kfree(state);
		kfree(state);
		state = NULL;
		state = NULL;
@@ -407,8 +407,7 @@ static void uvesafb_vbe_state_restore(struct uvesafb_par *par, u8 *state_buf)


	err = uvesafb_exec(task);
	err = uvesafb_exec(task);
	if (err || (task->t.regs.eax & 0xffff) != 0x004f)
	if (err || (task->t.regs.eax & 0xffff) != 0x004f)
		printk(KERN_WARNING "uvesafb: VBE state restore call "
		pr_warn("VBE state restore call failed (eax=0x%x, err=%d)\n",
				"failed (eax=0x%x, err=%d)\n",
			task->t.regs.eax, err);
			task->t.regs.eax, err);


	uvesafb_free(task);
	uvesafb_free(task);
@@ -427,24 +426,22 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,


	err = uvesafb_exec(task);
	err = uvesafb_exec(task);
	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
		printk(KERN_ERR "uvesafb: Getting VBE info block failed "
		pr_err("Getting VBE info block failed (eax=0x%x, err=%d)\n",
				"(eax=0x%x, err=%d)\n", (u32)task->t.regs.eax,
		       (u32)task->t.regs.eax, err);
				err);
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (par->vbe_ib.vbe_version < 0x0200) {
	if (par->vbe_ib.vbe_version < 0x0200) {
		printk(KERN_ERR "uvesafb: Sorry, pre-VBE 2.0 cards are "
		pr_err("Sorry, pre-VBE 2.0 cards are not supported\n");
				"not supported.\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (!par->vbe_ib.mode_list_ptr) {
	if (!par->vbe_ib.mode_list_ptr) {
		printk(KERN_ERR "uvesafb: Missing mode list!\n");
		pr_err("Missing mode list!\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	printk(KERN_INFO "uvesafb: ");
	pr_info("");


	/*
	/*
	 * Convert string pointers and the mode list pointer into
	 * Convert string pointers and the mode list pointer into
@@ -452,22 +449,23 @@ static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
	 * video adapter and its vendor.
	 * video adapter and its vendor.
	 */
	 */
	if (par->vbe_ib.oem_vendor_name_ptr)
	if (par->vbe_ib.oem_vendor_name_ptr)
		printk("%s, ",
		pr_cont("%s, ",
			((char *)task->buf) + par->vbe_ib.oem_vendor_name_ptr);
			((char *)task->buf) + par->vbe_ib.oem_vendor_name_ptr);


	if (par->vbe_ib.oem_product_name_ptr)
	if (par->vbe_ib.oem_product_name_ptr)
		printk("%s, ",
		pr_cont("%s, ",
			((char *)task->buf) + par->vbe_ib.oem_product_name_ptr);
			((char *)task->buf) + par->vbe_ib.oem_product_name_ptr);


	if (par->vbe_ib.oem_product_rev_ptr)
	if (par->vbe_ib.oem_product_rev_ptr)
		printk("%s, ",
		pr_cont("%s, ",
			((char *)task->buf) + par->vbe_ib.oem_product_rev_ptr);
			((char *)task->buf) + par->vbe_ib.oem_product_rev_ptr);


	if (par->vbe_ib.oem_string_ptr)
	if (par->vbe_ib.oem_string_ptr)
		printk("OEM: %s, ",
		pr_cont("OEM: %s, ",
			((char *)task->buf) + par->vbe_ib.oem_string_ptr);
			((char *)task->buf) + par->vbe_ib.oem_string_ptr);


	printk("VBE v%d.%d\n", ((par->vbe_ib.vbe_version & 0xff00) >> 8),
	pr_cont("VBE v%d.%d\n",
		(par->vbe_ib.vbe_version & 0xff00) >> 8,
		par->vbe_ib.vbe_version & 0xff);
		par->vbe_ib.vbe_version & 0xff);


	return 0;
	return 0;
@@ -507,8 +505,7 @@ static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task,


		err = uvesafb_exec(task);
		err = uvesafb_exec(task);
		if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
		if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
			printk(KERN_WARNING "uvesafb: Getting mode info block "
			pr_warn("Getting mode info block for mode 0x%x failed (eax=0x%x, err=%d)\n",
				"for mode 0x%x failed (eax=0x%x, err=%d)\n",
				*mode, (u32)task->t.regs.eax, err);
				*mode, (u32)task->t.regs.eax, err);
			mode++;
			mode++;
			par->vbe_modes_cnt--;
			par->vbe_modes_cnt--;
@@ -569,23 +566,20 @@ static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
						+ task->t.regs.edi);
						+ task->t.regs.edi);
		par->pmi_start = (u8 *)par->pmi_base + par->pmi_base[1];
		par->pmi_start = (u8 *)par->pmi_base + par->pmi_base[1];
		par->pmi_pal = (u8 *)par->pmi_base + par->pmi_base[2];
		par->pmi_pal = (u8 *)par->pmi_base + par->pmi_base[2];
		printk(KERN_INFO "uvesafb: protected mode interface info at "
		pr_info("protected mode interface info at %04x:%04x\n",
				 "%04x:%04x\n",
			(u16)task->t.regs.es, (u16)task->t.regs.edi);
			(u16)task->t.regs.es, (u16)task->t.regs.edi);
		printk(KERN_INFO "uvesafb: pmi: set display start = %p, "
		pr_info("pmi: set display start = %p, set palette = %p\n",
				 "set palette = %p\n", par->pmi_start,
			par->pmi_start, par->pmi_pal);
				 par->pmi_pal);


		if (par->pmi_base[3]) {
		if (par->pmi_base[3]) {
			printk(KERN_INFO "uvesafb: pmi: ports = ");
			pr_info("pmi: ports =");
			for (i = par->pmi_base[3]/2;
			for (i = par->pmi_base[3]/2;
					par->pmi_base[i] != 0xffff; i++)
					par->pmi_base[i] != 0xffff; i++)
				printk("%x ", par->pmi_base[i]);
				pr_cont(" %x", par->pmi_base[i]);
			printk("\n");
			pr_cont("\n");


			if (par->pmi_base[i] != 0xffff) {
			if (par->pmi_base[i] != 0xffff) {
				printk(KERN_INFO "uvesafb: can't handle memory"
				pr_info("can't handle memory requests, pmi disabled\n");
						 " requests, pmi disabled\n");
				par->ypan = par->pmi_setpal = 0;
				par->ypan = par->pmi_setpal = 0;
			}
			}
		}
		}
@@ -634,17 +628,13 @@ static int uvesafb_vbe_getedid(struct uvesafb_ktask *task, struct fb_info *info)
		return -EINVAL;
		return -EINVAL;


	if ((task->t.regs.ebx & 0x3) == 3) {
	if ((task->t.regs.ebx & 0x3) == 3) {
		printk(KERN_INFO "uvesafb: VBIOS/hardware supports both "
		pr_info("VBIOS/hardware supports both DDC1 and DDC2 transfers\n");
				 "DDC1 and DDC2 transfers\n");
	} else if ((task->t.regs.ebx & 0x3) == 2) {
	} else if ((task->t.regs.ebx & 0x3) == 2) {
		printk(KERN_INFO "uvesafb: VBIOS/hardware supports DDC2 "
		pr_info("VBIOS/hardware supports DDC2 transfers\n");
				 "transfers\n");
	} else if ((task->t.regs.ebx & 0x3) == 1) {
	} else if ((task->t.regs.ebx & 0x3) == 1) {
		printk(KERN_INFO "uvesafb: VBIOS/hardware supports DDC1 "
		pr_info("VBIOS/hardware supports DDC1 transfers\n");
				 "transfers\n");
	} else {
	} else {
		printk(KERN_INFO "uvesafb: VBIOS/hardware doesn't support "
		pr_info("VBIOS/hardware doesn't support DDC transfers\n");
				 "DDC transfers\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


@@ -718,14 +708,12 @@ static void uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
	}
	}


	if (info->monspecs.gtf)
	if (info->monspecs.gtf)
		printk(KERN_INFO
		pr_info("monitor limits: vf = %d Hz, hf = %d kHz, clk = %d MHz\n",
			"uvesafb: monitor limits: vf = %d Hz, hf = %d kHz, "
			info->monspecs.vfmax,
			"clk = %d MHz\n", info->monspecs.vfmax,
			(int)(info->monspecs.hfmax / 1000),
			(int)(info->monspecs.hfmax / 1000),
			(int)(info->monspecs.dclkmax / 1000000));
			(int)(info->monspecs.dclkmax / 1000000));
	else
	else
		printk(KERN_INFO "uvesafb: no monitor limits have been set, "
		pr_info("no monitor limits have been set, default refresh rate will be used\n");
				 "default refresh rate will be used\n");


	/* Add VBE modes to the modelist. */
	/* Add VBE modes to the modelist. */
	for (i = 0; i < par->vbe_modes_cnt; i++) {
	for (i = 0; i < par->vbe_modes_cnt; i++) {
@@ -779,8 +767,7 @@ static void uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
	err = uvesafb_exec(task);
	err = uvesafb_exec(task);


	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
	if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
		printk(KERN_WARNING "uvesafb: VBE state buffer size "
		pr_warn("VBE state buffer size cannot be determined (eax=0x%x, err=%d)\n",
			"cannot be determined (eax=0x%x, err=%d)\n",
			task->t.regs.eax, err);
			task->t.regs.eax, err);
		par->vbe_state_size = 0;
		par->vbe_state_size = 0;
		return;
		return;
@@ -815,8 +802,7 @@ static int uvesafb_vbe_init(struct fb_info *info)
	if (par->pmi_setpal || par->ypan) {
	if (par->pmi_setpal || par->ypan) {
		if (__supported_pte_mask & _PAGE_NX) {
		if (__supported_pte_mask & _PAGE_NX) {
			par->pmi_setpal = par->ypan = 0;
			par->pmi_setpal = par->ypan = 0;
			printk(KERN_WARNING "uvesafb: NX protection is active, "
			pr_warn("NX protection is active, better not use the PMI\n");
					    "better not use the PMI.\n");
		} else {
		} else {
			uvesafb_vbe_getpmi(task, par);
			uvesafb_vbe_getpmi(task, par);
		}
		}
@@ -859,8 +845,7 @@ static int uvesafb_vbe_init_mode(struct fb_info *info)
				goto gotmode;
				goto gotmode;
			}
			}
		}
		}
		printk(KERN_INFO "uvesafb: requested VBE mode 0x%x is "
		pr_info("requested VBE mode 0x%x is unavailable\n", vbemode);
				 "unavailable\n", vbemode);
		vbemode = 0;
		vbemode = 0;
	}
	}


@@ -1181,8 +1166,8 @@ static int uvesafb_open(struct fb_info *info, int user)
	if (!cnt && par->vbe_state_size) {
	if (!cnt && par->vbe_state_size) {
		buf =  uvesafb_vbe_state_save(par);
		buf =  uvesafb_vbe_state_save(par);
		if (IS_ERR(buf)) {
		if (IS_ERR(buf)) {
			printk(KERN_WARNING "uvesafb: save hardware state"
			pr_warn("save hardware state failed, error code is %ld!\n",
				"failed, error code is %ld!\n", PTR_ERR(buf));
				PTR_ERR(buf));
		} else {
		} else {
			par->vbe_state_orig = buf;
			par->vbe_state_orig = buf;
		}
		}
@@ -1293,17 +1278,16 @@ static int uvesafb_set_par(struct fb_info *info)
		 * use our own timings.  Try again with the default timings.
		 * use our own timings.  Try again with the default timings.
		 */
		 */
		if (crtc != NULL) {
		if (crtc != NULL) {
			printk(KERN_WARNING "uvesafb: mode switch failed "
			pr_warn("mode switch failed (eax=0x%x, err=%d) - trying again with default timings\n",
				"(eax=0x%x, err=%d). Trying again with "
				task->t.regs.eax, err);
				"default timings.\n", task->t.regs.eax, err);
			uvesafb_reset(task);
			uvesafb_reset(task);
			kfree(crtc);
			kfree(crtc);
			crtc = NULL;
			crtc = NULL;
			info->var.pixclock = 0;
			info->var.pixclock = 0;
			goto setmode;
			goto setmode;
		} else {
		} else {
			printk(KERN_ERR "uvesafb: mode switch failed (eax="
			pr_err("mode switch failed (eax=0x%x, err=%d)\n",
				"0x%x, err=%d)\n", task->t.regs.eax, err);
			       task->t.regs.eax, err);
			err = -EINVAL;
			err = -EINVAL;
			goto out;
			goto out;
		}
		}
@@ -1510,13 +1494,11 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
				 mode->bytes_per_scan_line;
				 mode->bytes_per_scan_line;


	if (par->ypan && info->var.yres_virtual > info->var.yres) {
	if (par->ypan && info->var.yres_virtual > info->var.yres) {
		printk(KERN_INFO "uvesafb: scrolling: %s "
		pr_info("scrolling: %s using protected mode interface, yres_virtual=%d\n",
			"using protected mode interface, "
			"yres_virtual=%d\n",
			(par->ypan > 1) ? "ywrap" : "ypan",
			(par->ypan > 1) ? "ywrap" : "ypan",
			info->var.yres_virtual);
			info->var.yres_virtual);
	} else {
	} else {
		printk(KERN_INFO "uvesafb: scrolling: redraw\n");
		pr_info("scrolling: redraw\n");
		info->var.yres_virtual = info->var.yres;
		info->var.yres_virtual = info->var.yres;
		par->ypan = 0;
		par->ypan = 0;
	}
	}
@@ -1704,7 +1686,7 @@ static int uvesafb_probe(struct platform_device *dev)


	err = uvesafb_vbe_init(info);
	err = uvesafb_vbe_init(info);
	if (err) {
	if (err) {
		printk(KERN_ERR "uvesafb: vbe_init() failed with %d\n", err);
		pr_err("vbe_init() failed with %d\n", err);
		goto out;
		goto out;
	}
	}


@@ -1726,15 +1708,15 @@ static int uvesafb_probe(struct platform_device *dev)
	uvesafb_init_info(info, mode);
	uvesafb_init_info(info, mode);


	if (!request_region(0x3c0, 32, "uvesafb")) {
	if (!request_region(0x3c0, 32, "uvesafb")) {
		printk(KERN_ERR "uvesafb: request region 0x3c0-0x3e0 failed\n");
		pr_err("request region 0x3c0-0x3e0 failed\n");
		err = -EIO;
		err = -EIO;
		goto out_mode;
		goto out_mode;
	}
	}


	if (!request_mem_region(info->fix.smem_start, info->fix.smem_len,
	if (!request_mem_region(info->fix.smem_start, info->fix.smem_len,
				"uvesafb")) {
				"uvesafb")) {
		printk(KERN_ERR "uvesafb: cannot reserve video memory at "
		pr_err("cannot reserve video memory at 0x%lx\n",
				"0x%lx\n", info->fix.smem_start);
		       info->fix.smem_start);
		err = -EIO;
		err = -EIO;
		goto out_reg;
		goto out_reg;
	}
	}
@@ -1743,9 +1725,7 @@ static int uvesafb_probe(struct platform_device *dev)
	uvesafb_ioremap(info);
	uvesafb_ioremap(info);


	if (!info->screen_base) {
	if (!info->screen_base) {
		printk(KERN_ERR
		pr_err("abort, cannot ioremap 0x%x bytes of video memory at 0x%lx\n",
			"uvesafb: abort, cannot ioremap 0x%x bytes of video "
			"memory at 0x%lx\n",
		       info->fix.smem_len, info->fix.smem_start);
		       info->fix.smem_len, info->fix.smem_start);
		err = -EIO;
		err = -EIO;
		goto out_mem;
		goto out_mem;
@@ -1754,16 +1734,14 @@ static int uvesafb_probe(struct platform_device *dev)
	platform_set_drvdata(dev, info);
	platform_set_drvdata(dev, info);


	if (register_framebuffer(info) < 0) {
	if (register_framebuffer(info) < 0) {
		printk(KERN_ERR
		pr_err("failed to register framebuffer device\n");
			"uvesafb: failed to register framebuffer device\n");
		err = -EINVAL;
		err = -EINVAL;
		goto out_unmap;
		goto out_unmap;
	}
	}


	printk(KERN_INFO "uvesafb: framebuffer at 0x%lx, mapped to 0x%p, "
	pr_info("framebuffer at 0x%lx, mapped to 0x%p, using %dk, total %dk\n",
			"using %dk, total %dk\n", info->fix.smem_start,
		info->fix.smem_start, info->screen_base,
			info->screen_base, info->fix.smem_len/1024,
		info->fix.smem_len / 1024, par->vbe_ib.total_memory * 64);
			par->vbe_ib.total_memory * 64);
	fb_info(info, "%s frame buffer device\n", info->fix.id);
	fb_info(info, "%s frame buffer device\n", info->fix.id);


	err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
	err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
@@ -1871,8 +1849,7 @@ static int uvesafb_setup(char *options)
		else if (this_opt[0] >= '0' && this_opt[0] <= '9') {
		else if (this_opt[0] >= '0' && this_opt[0] <= '9') {
			mode_option = this_opt;
			mode_option = this_opt;
		} else {
		} else {
			printk(KERN_WARNING
			pr_warn("unrecognized option %s\n", this_opt);
				"uvesafb: unrecognized option %s\n", this_opt);
		}
		}
	}
	}


@@ -1931,8 +1908,7 @@ static int uvesafb_init(void)
		err = driver_create_file(&uvesafb_driver.driver,
		err = driver_create_file(&uvesafb_driver.driver,
				&driver_attr_v86d);
				&driver_attr_v86d);
		if (err) {
		if (err) {
			printk(KERN_WARNING "uvesafb: failed to register "
			pr_warn("failed to register attributes\n");
					"attributes\n");
			err = 0;
			err = 0;
		}
		}
	}
	}