linux-stable/arch/mips
Paul Burton 7784cac697
MIPS: cmdline: Clean up boot_command_line initialization
Our current code to initialize boot_command_line is a mess. Some of this
is due to the addition of too many options over the years, and some of
this is due to workarounds for early_init_dt_scan_chosen() performing
actions specific to options from other architectures that probably
shouldn't be in generic code.

Clean this up by introducing a new bootcmdline_init() function that
simplifies the initialization somewhat. The major changes are:

- Because bootcmdline_init() is a function it can return early in the
  CONFIG_CMDLINE_OVERRIDE case.

- We clear boot_command_line rather than inheriting whatever
  early_init_dt_scan_chosen() may have left us. This means we no longer
  need to set boot_command_line to a space character in an attempt to
  prevent early_init_dt_scan_chosen() from copying CONFIG_CMDLINE into
  boot_command_line without us knowing about it.

- Indirection via USE_PROM_CMDLINE, USE_DTB_CMDLINE, EXTEND_WITH_PROM &
  BUILTIN_EXTEND_WITH_PROM macros is removed; they seemingly served only
  to obfuscate the code.

- The logic is cleaner, clearer & commented.

Two minor drawbacks of this approach are:

1) We call of_scan_flat_dt(), which means we scan through the DT again.
   The overhead is fairly minimal & shouldn't be noticeable.

2) cmdline_scan_chosen() duplicates a small amount of the logic from
   early_init_dt_scan_chosen(). Alternatives might be to allow the
   generic FDT code to keep & expose a copy of the arguments taken from
   the /chosen node's bootargs property, or to introduce a function like
   early_init_dt_scan_chosen() that retrieves them without modification
   to handle CONFIG_CMDLINE. Neither of these sounds particularly
   cleaner though, and this way we at least keep the extra work in
   arch/mips.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
2019-10-10 11:56:43 -07:00
..
alchemy
ar7 The main MIPS changes for a pretty light v5.3 cycle, including: 2019-07-17 09:42:03 -07:00
ath25
ath79 The main MIPS changes for a pretty light v5.3 cycle, including: 2019-07-17 09:42:03 -07:00
bcm47xx MIPS: BCM47XX: Add support for Netgear R6200 V1 2019-07-25 22:10:05 -07:00
bcm63xx MIPS: fix some more fall through errors in arch/mips 2019-07-16 12:40:16 +01:00
bmips docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
boot MIPS: CI20: DTS: Add Leds 2019-10-07 09:46:22 -07:00
cavium-octeon Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
cobalt
configs Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
crypto
dec
emma
fw MIPS: SGI-IP22/28: Use PROM for memory detection 2019-10-09 14:55:57 -07:00
generic MIPS: generic: Use __initconst for const init data 2019-10-08 10:54:44 -07:00
include MIPS: SGI-IP22/28: Use PROM for memory detection 2019-10-09 14:55:57 -07:00
jazz dma-mapping: explicitly wire up ->mmap and ->get_sgtable 2019-09-04 11:13:18 +02:00
jz4740 Merge branch 'ingenic-tcu-v5.4' into mips-next 2019-08-08 15:33:16 -07:00
kernel MIPS: cmdline: Clean up boot_command_line initialization 2019-10-10 11:56:43 -07:00
kvm Bugfixes (arm and x86) and cleanups. 2019-08-09 15:46:29 -07:00
lantiq MIPS: lantiq: update the clock alias' for the mainline PCIe PHY driver 2019-08-24 15:13:22 +01:00
lasat
lib MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG 2019-10-07 09:42:55 -07:00
loongson32
loongson64 MIPS: Loongson-3: Add CSR IPI support 2019-10-07 09:45:25 -07:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 454 2019-06-19 17:09:09 +02:00
mm MIPS: Provide unroll() macro, use it for cache ops 2019-10-09 12:47:56 -07:00
mti-malta MIPS: malta: Drop prom_free_prom_memory 2019-08-23 14:47:13 +01:00
net treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
netlogic MIPS: xlp: Drop boot_mem_map 2019-08-23 14:47:21 +01:00
oprofile MIPS: OProfile: Mark expected switch fall-throughs 2019-07-30 09:40:17 -07:00
paravirt
pci MIPS: PCI: use information from 1-wire PROM for IOC3 detection 2019-10-07 09:47:40 -07:00
pic32 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pistachio A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
pmcs-msp71xx MIPS: pmcs-msp71xx: Remove unused addr variable 2019-10-03 15:47:17 -07:00
pnx833x A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
power mips: check for dsp presence only once before save/restore 2019-10-07 10:58:53 -07:00
ralink MIPS: ralink: deactivate PCI support for SOC_MT7621 2019-09-06 08:45:03 -07:00
rb532
sgi-ip22 MIPS: SGI-IP22/28: Use PROM for memory detection 2019-10-09 14:55:57 -07:00
sgi-ip27 MIPS: PCI: use information from 1-wire PROM for IOC3 detection 2019-10-07 09:47:40 -07:00
sgi-ip32 Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
sibyte
sni treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 210 2019-05-30 11:29:53 -07:00
tools MIPS: Check Loongson3 LL/SC errata workaround correctness 2019-10-07 09:43:13 -07:00
txx9 A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
vdso MIPS: VDSO: Fix build for binutils < 2.25 2019-10-02 14:07:32 -07:00
vr41xx
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kbuild.platforms treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kconfig MIPS: SGI-IP22/28: Use PROM for memory detection 2019-10-09 14:55:57 -07:00
Kconfig.debug MIPS: cmdline: Remove redundant Kconfig defaults 2019-10-09 15:53:16 -07:00
Makefile MIPS: Check Loongson3 LL/SC errata workaround correctness 2019-10-07 09:43:13 -07:00
Makefile.postlink MIPS: Check Loongson3 LL/SC errata workaround correctness 2019-10-07 09:43:13 -07:00