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

Commit 83b1bfba authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Greg Kroah-Hartman
Browse files

FMC: show_sdb_tree: fix offset calculation



The code reported wrong addresses in the sdb dumps.  All sdb addresses
are relative, but the code was adding the base address twice.  Bug
exposed by a gateware image with two bridge levels.

Thanks David for reporting the problem.

Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
Reported-by: default avatarJuan David Gonzalez Cobas <dcobas@cern.ch>
Tested-by: default avatarJuan David Gonzalez Cobas <dcobas@cern.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e4d6c4b7
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -153,20 +153,17 @@ EXPORT_SYMBOL(fmc_reprogram);
static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
				const struct sdb_array *arr)
				const struct sdb_array *arr)
{
{
	unsigned long base = arr->baseaddr;
	int i, j, n = arr->len, level = arr->level;
	int i, j, n = arr->len, level = arr->level;
	const struct sdb_array *ap;


	for (i = 0; i < n; i++) {
	for (i = 0; i < n; i++) {
		unsigned long base;
		union  sdb_record *r;
		union  sdb_record *r;
		struct sdb_product *p;
		struct sdb_product *p;
		struct sdb_component *c;
		struct sdb_component *c;
		r = &arr->record[i];
		r = &arr->record[i];
		c = &r->dev.sdb_component;
		c = &r->dev.sdb_component;
		p = &c->product;
		p = &c->product;
		base = 0;

		for (ap = arr; ap; ap = ap->parent)
			base += ap->baseaddr;
		dev_info(&fmc->dev, "SDB: ");
		dev_info(&fmc->dev, "SDB: ");


		for (j = 0; j < level; j++)
		for (j = 0; j < level; j++)