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

Commit 68616504 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] tm6000: don't break long lines



Due to the 80-cols restrictions, and latter due to checkpatch
warnings, several strings were broken into multiple lines. This
is not considered a good practice anymore, as it makes harder
to grep for strings at the source code.

As we're right now fixing other drivers due to KERN_CONT, we need
to be able to identify what printk strings don't end with a "\n".
It is a way easier to detect those if we don't break long lines.

So, join those continuation lines.

The patch was generated via the script below, and manually
adjusted if needed.

</script>
use Text::Tabs;
while (<>) {
	if ($next ne "") {
		$c=$_;
		if ($c =~ /^\s+\"(.*)/) {
			$c2=$1;
			$next =~ s/\"\n$//;
			$n = expand($next);
			$funpos = index($n, '(');
			$pos = index($c2, '",');
			if ($funpos && $pos > 0) {
				$s1 = substr $c2, 0, $pos + 2;
				$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
				$s2 =~ s/^\s+//;

				$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");

				print unexpand("$next$s1\n");
				print unexpand("$s2\n") if ($s2 ne "");
			} else {
				print "$next$c2\n";
			}
			$next="";
			next;
		} else {
			print $next;
		}
		$next="";
	} else {
		if (m/\"$/) {
			if (!m/\\n\"$/) {
				$next=$_;
				next;
			}
		}
	}
	print $_;
}
</script>

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent b4b3f99c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -58,9 +58,7 @@ MODULE_PARM_DESC(index, "Index value for tm6000x capture interface(s).");
MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards");
MODULE_AUTHOR("Mauro Carvalho Chehab");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},"
			"{{Trident,tm6000},"
			"{{Trident,tm6010}");
MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}");
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
+6 −8
Original line number Diff line number Diff line
@@ -602,8 +602,8 @@ int tm6000_init(struct tm6000_core *dev)
	for (i = 0; i < size; i++) {
		rc = tm6000_set_reg(dev, tab[i].req, tab[i].reg, tab[i].val);
		if (rc < 0) {
			printk(KERN_ERR "Error %i while setting req %d, "
					"reg %d to value %d\n", rc,
			printk(KERN_ERR "Error %i while setting req %d, reg %d to value %d\n",
			       rc,
					tab[i].req, tab[i].reg, tab[i].val);
			return rc;
		}
@@ -761,9 +761,8 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute)
		if (dev->dev_type == TM6010)
			tm6010_set_mute_sif(dev, mute);
		else {
			printk(KERN_INFO "ERROR: TM5600 and TM6000 don't has"
					" SIF audio inputs. Please check the %s"
					" configuration.\n", dev->name);
			printk(KERN_INFO "ERROR: TM5600 and TM6000 don't has SIF audio inputs. Please check the %s configuration.\n",
			       dev->name);
			return -EINVAL;
		}
		break;
@@ -822,9 +821,8 @@ void tm6000_set_volume(struct tm6000_core *dev, int vol)
		if (dev->dev_type == TM6010)
			tm6010_set_volume_sif(dev, vol);
		else
			printk(KERN_INFO "ERROR: TM5600 and TM6000 don't has"
					" SIF audio inputs. Please check the %s"
					" configuration.\n", dev->name);
			printk(KERN_INFO "ERROR: TM5600 and TM6000 don't has SIF audio inputs. Please check the %s configuration.\n",
			       dev->name);
		break;
	case TM6000_AMUX_ADC1:
	case TM6000_AMUX_ADC2:
+5 −11
Original line number Diff line number Diff line
@@ -35,9 +35,7 @@ MODULE_DESCRIPTION("DVB driver extension module for tm5600/6000/6010 based TV ca
MODULE_AUTHOR("Mauro Carvalho Chehab");
MODULE_LICENSE("GPL");

MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},"
			"{{Trident, tm6000},"
			"{{Trident, tm6010}");
MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}");

static int debug;

@@ -292,13 +290,11 @@ static int register_dvb(struct tm6000_core *dev)
			}

			if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
				printk(KERN_ERR "tm6000: couldn't register "
						"frontend (xc3028)\n");
				printk(KERN_ERR "tm6000: couldn't register frontend (xc3028)\n");
				ret = -EINVAL;
				goto frontend_err;
			}
			printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
					 "attached to frontend!\n");
			printk(KERN_INFO "tm6000: XC2028/3028 asked to be attached to frontend!\n");
			break;
			}
		case TUNER_XC5000: {
@@ -315,13 +311,11 @@ static int register_dvb(struct tm6000_core *dev)
			}

			if (!dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &cfg)) {
				printk(KERN_ERR "tm6000: couldn't register "
						"frontend (xc5000)\n");
				printk(KERN_ERR "tm6000: couldn't register frontend (xc5000)\n");
				ret = -EINVAL;
				goto frontend_err;
			}
			printk(KERN_INFO "tm6000: XC5000 asked to be "
					 "attached to frontend!\n");
			printk(KERN_INFO "tm6000: XC5000 asked to be attached to frontend!\n");
			break;
			}
		}
+1 −2
Original line number Diff line number Diff line
@@ -173,8 +173,7 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
			 * immediately after a 1 or 2 byte write to select
			 * a register.  We cannot fulfil this request.
			 */
			i2c_dprintk(2, " read without preceding write not"
				       " supported");
			i2c_dprintk(2, " read without preceding write not supported");
			rc = -EOPNOTSUPP;
			goto err;
		} else if (i + 1 < num && msgs[i].len <= 2 &&
+1 −2
Original line number Diff line number Diff line
@@ -464,8 +464,7 @@ static int tm6000_load_std(struct tm6000_core *dev, struct tm6000_reg_settings *
	for (i = 0; set[i].req; i++) {
		rc = tm6000_set_reg(dev, set[i].req, set[i].reg, set[i].value);
		if (rc < 0) {
			printk(KERN_ERR "Error %i while setting "
			       "req %d, reg %d to value %d\n",
			printk(KERN_ERR "Error %i while setting req %d, reg %d to value %d\n",
			       rc, set[i].req, set[i].reg, set[i].value);
			return rc;
		}
Loading