Commit 6cdc31b2 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: media/*/Kconfig: sort entries



Currently, the idems inside media Kconfig are out of order.
Sort them using the script below:

<script>
use strict;
use warnings;

my %config;
my @source;
my $out;

sub flush_config()
{
	if (scalar %config) {
		for my $c (sort keys %config) {
			$out .= $config{$c} . "\n";
		}
		%config = ();
	}

	return if (!scalar @source);

	$out .= "\n";
	for my $s (sort @source) {
		$out .= $s;
	}
	$out .= "\n";

	@source = ();
}

sub sort_kconfig($)
{
	my $fname = shift;
	my $cur_config = "";

	@source = ();
	$out = "";
	%config = ();

	open IN, $fname or die;
	while (<IN>) {
		if (m/^config\s+(.*)/) {
			$cur_config = $1;
			$config{$cur_config} .= $_;
		} elsif (m/^source\s+(.*)/) {
			push @source, $_;
		} elsif (m/^\s+/) {
			if ($cur_config eq "") {
				$out .= $_;
			} else {
				$config{$cur_config} .= $_;
			}
		} else {
			flush_config();
			$cur_config = "";
			$out .= $_;
		}
	}
	close IN or die;

	flush_config();

	$out =~ s/\n\n+/\n\n/g;
	$out =~ s/\n+$/\n/;

	open OUT, ">$fname";
	print OUT $out;
	close OUT;
}

for my $fname(@ARGV) {
	sort_kconfig $fname
}
</script>

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 9958d30f
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -6,23 +6,23 @@ config MEDIA_COMMON_OPTIONS
comment "common driver options"
	depends on MEDIA_COMMON_OPTIONS

config VIDEO_CX2341X
config CYPRESS_FIRMWARE
	tristate
	depends on USB

config VIDEO_TVEEPROM
config TTPCI_EEPROM
        tristate
        depends on I2C

config TTPCI_EEPROM
config VIDEO_CX2341X
	tristate
        depends on I2C

config CYPRESS_FIRMWARE
config VIDEO_TVEEPROM
	tristate
	depends on USB
	depends on I2C

source "drivers/media/common/videobuf2/Kconfig"
source "drivers/media/common/b2c2/Kconfig"
source "drivers/media/common/saa7146/Kconfig"
source "drivers/media/common/siano/Kconfig"
source "drivers/media/common/v4l2-tpg/Kconfig"
source "drivers/media/common/videobuf2/Kconfig"
+330 −331

File changed.

Preview size limit exceeded, changes collapsed.

+316 −312

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

source "drivers/media/mmc/siano/Kconfig"
+18 −11

File changed.

Preview size limit exceeded, changes collapsed.

Loading