Commit e0f691de authored by Helge Deller's avatar Helge Deller Committed by Lipeng Sang
Browse files

parisc: Avoid printing the hardware path twice

stable inclusion
from stable-v5.10.154
commit c9598cf629530823fd5d6c3342311895de504707
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c9598cf629530823fd5d6c3342311895de504707



--------------------------------

commit 2b6ae096 upstream.

Avoid that the hardware path is shown twice in the kernel log, and clean
up the output of the version numbers to show up in the same order as
they are listed in the hardware database in the hardware.c file.
Additionally, optimize the memory footprint of the hardware database
and mark some code as init code.

Fixes: cab56b51 ("parisc: Fix device names in /proc/iomem")
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent 382cc186
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -10,12 +10,12 @@
#define SVERSION_ANY_ID		PA_SVERSION_ANY_ID

struct hp_hardware {
	unsigned short	hw_type:5;	/* HPHW_xxx */
	unsigned short	hversion;
	unsigned long	sversion:28;
	unsigned short	opt;
	const char	name[80];	/* The hardware description */
};
	unsigned int	hw_type:8;	/* HPHW_xxx */
	unsigned int	hversion:12;
	unsigned int	sversion:12;
	unsigned char	opt;
	unsigned char	name[59];	/* The hardware description */
} __packed;

struct parisc_device;

+6 −8
Original line number Diff line number Diff line
@@ -883,15 +883,13 @@ void __init walk_central_bus(void)
			&root);
}

static void print_parisc_device(struct parisc_device *dev)
static __init void print_parisc_device(struct parisc_device *dev)
{
	char hw_path[64];
	static int count;
	static int count __initdata;

	print_pa_hwpath(dev, hw_path);
	pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
		++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
		dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
	pr_info("%d. %s at %pap { type:%d, hv:%#x, sv:%#x, rev:%#x }",
		++count, dev->name, &(dev->hpa.start), dev->id.hw_type,
		dev->id.hversion, dev->id.sversion, dev->id.hversion_rev);

	if (dev->num_addrs) {
		int k;
@@ -1080,7 +1078,7 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)



static int print_one_device(struct device * dev, void * data)
static __init int print_one_device(struct device * dev, void * data)
{
	struct parisc_device * pdev = to_parisc_device(dev);