Skip to contentSkip to conversation

Patch "of: fix sparse warning in of_pci_range_parser_one" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message May 22, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

of: fix sparse warning in of_pci_range_parser_one

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
of-fix-sparse-warning-in-of_pci_range_parser_one.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From eb3100365791b06242b8bb5c3c2854ba41dabfbc Mon Sep 17 00:00:00 2001

From: Rob Herring <[email protected]>
Date: Thu, 4 May 2017 12:34:30 -0500
Subject: of: fix sparse warning in of_pci_range_parser_one

From: Rob Herring <[email protected]>

commit eb3100365791b06242b8bb5c3c2854ba41dabfbc upstream.

sparse gives the following warning for 'pci_space':

../drivers/of/address.c:266:26: warning: incorrect type in assignment (different base types)
../drivers/of/address.c:266:26: expected unsigned int [unsigned] [usertype] pci_space
../drivers/of/address.c:266:26: got restricted __be32 const [usertype] <noident>

It appears that pci_space is only ever accessed on powerpc, so the endian swap is often not needed.

---
 drivers/of/address.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/address.c +1 -1
@@ -263,7 +263,7 @@ struct of_pci_range *of_pci_range_parser
 	if (!parser->range || parser->range + parser->np > parser->end)
 		return NULL;
 
-	range->pci_space = parser->range[0];
+	range->pci_space = be32_to_cpup(parser->range);
 	range->flags = of_bus_pci_get_flags(parser->range);
 	range->pci_addr = of_read_number(parser->range + 1, ns);
 	range->cpu_addr = of_translate_address(parser->node,

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/of-fix-sparse-warning-in-of_pci_range_parser_one.patch queue-4.9/of-fdt-add-missing-allocation-failure-check.patch queue-4.9/of-fix-cpus-reference-leak-in-of_numa_parse_cpu_nodes.patch