FDT.pm: consistently check defined()

In a few cases, we check not $var to check if a var has a defined value.
This also catches the case where $var has a defined value, but evaluates
to false (e.g. if $var is zero).

In FDT::Node::get_translated_reg(), this erroneous check means that reg
entries with an address zero will not be translated, even where there is
a valid set of ranges properties in parent nodes.

Elsewhere, this is simply inconsistent, but not otherwise harmful.

Fix the code to use defined($var) consistently.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
1 file changed