Skip to content

Commit

Permalink
Merge tag 'devicetree-fixes-for-4.12' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/robh/linux

Pull DeviceTree fixes from Rob Herring:

 - fix missing allocation failure handling in fdt code

 - fix dtc compile error on 32-bit hosts

 - revert bad sparse changes causing GCC7 warnings

* tag 'devicetree-fixes-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: fdt: add missing allocation-failure check
  dtc: check.c fix compile error
  Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
  • Loading branch information
torvalds committed May 19, 2017
2 parents f538a82 + 49e67dd commit 1fbbed4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ void *__unflatten_device_tree(const void *blob,

/* Allocate memory for the expanded device tree */
mem = dt_alloc(size + 4, __alignof__(struct device_node));
if (!mem)
return NULL;

memset(mem, 0, size);

*(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef);
Expand Down
2 changes: 1 addition & 1 deletion drivers/of/of_reserved_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem)
const struct of_device_id *i;

for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) {
int const (*initfn)(struct reserved_mem *rmem) = i->data;
reservedmem_of_init_fn initfn = i->data;
const char *compat = i->compatible;

if (!of_flat_dt_is_compatible(rmem->fdt_node, compat))
Expand Down
2 changes: 1 addition & 1 deletion include/linux/of_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <linux/ioport.h>
#include <linux/of.h>

typedef int const (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);

/*
* Workarounds only applied to 32bit powermac machines
Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct no
while (size--)
reg = (reg << 32) | fdt32_to_cpu(*(cells++));

snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
if (!streq(unitname, unit_addr))
FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
node->fullpath, unit_addr);
Expand Down

0 comments on commit 1fbbed4

Please sign in to comment.