bsps/shared/ofw/ofw.c: Correct comparisons of different signedness

The GCC warning -Wsign-compare flagged these instances of comparing
signed and unsigned types. A common pair was size_t and int.
This commit is contained in:
Joel Sherrill
2025-11-06 10:26:10 -06:00
parent 88bce4ee7f
commit 7ab332d86f

View File

@@ -187,7 +187,7 @@ ssize_t rtems_ofw_get_prop(
const void *prop;
int offset;
int len;
int copy_len;
size_t copy_len;
uint32_t cpuid;
offset = rtems_fdt_phandle_to_offset(node);
@@ -251,7 +251,7 @@ ssize_t rtems_ofw_get_enc_prop(
return rv;
}
for (int i = 0; i < (len / 4); i++) {
for (size_t i = 0; i < (len / 4); i++) {
buf[i] = fdt32_to_cpu(buf[i]);
}
@@ -540,7 +540,8 @@ phandle_t rtems_ofw_node_from_xref( phandle_t xref )
{
phandle_t node;
if ((node = rtems_ofw_get_effective_phandle(rtems_ofw_peer(0), xref)) == -1)
node = rtems_ofw_get_effective_phandle(rtems_ofw_peer(0), xref);
if (node == (phandle_t)-1)
return xref;
return node;