\r
#include "libfdt_internal.h"\r
\r
-int fdt_address_cells(const void *fdt, int nodeoffset)\r
+int\r
+fdt_address_cells (\r
+ const void *fdt,\r
+ int nodeoffset\r
+ )\r
{\r
- const fdt32_t *ac;\r
- int val;\r
- int len;\r
+ const fdt32_t *ac;\r
+ int val;\r
+ int len;\r
\r
- ac = fdt_getprop(fdt, nodeoffset, "#address-cells", &len);\r
- if (!ac)\r
- return 2;\r
+ ac = fdt_getprop (fdt, nodeoffset, "#address-cells", &len);\r
+ if (!ac) {\r
+ return 2;\r
+ }\r
\r
- if (len != sizeof(*ac))\r
- return -FDT_ERR_BADNCELLS;\r
+ if (len != sizeof (*ac)) {\r
+ return -FDT_ERR_BADNCELLS;\r
+ }\r
\r
- val = fdt32_to_cpu(*ac);\r
- if ((val <= 0) || (val > FDT_MAX_NCELLS))\r
- return -FDT_ERR_BADNCELLS;\r
+ val = fdt32_to_cpu (*ac);\r
+ if ((val <= 0) || (val > FDT_MAX_NCELLS)) {\r
+ return -FDT_ERR_BADNCELLS;\r
+ }\r
\r
- return val;\r
+ return val;\r
}\r
\r
-int fdt_size_cells(const void *fdt, int nodeoffset)\r
+int\r
+fdt_size_cells (\r
+ const void *fdt,\r
+ int nodeoffset\r
+ )\r
{\r
- const fdt32_t *sc;\r
- int val;\r
- int len;\r
+ const fdt32_t *sc;\r
+ int val;\r
+ int len;\r
\r
- sc = fdt_getprop(fdt, nodeoffset, "#size-cells", &len);\r
- if (!sc)\r
- return 2;\r
+ sc = fdt_getprop (fdt, nodeoffset, "#size-cells", &len);\r
+ if (!sc) {\r
+ return 2;\r
+ }\r
\r
- if (len != sizeof(*sc))\r
- return -FDT_ERR_BADNCELLS;\r
+ if (len != sizeof (*sc)) {\r
+ return -FDT_ERR_BADNCELLS;\r
+ }\r
\r
- val = fdt32_to_cpu(*sc);\r
- if ((val < 0) || (val > FDT_MAX_NCELLS))\r
- return -FDT_ERR_BADNCELLS;\r
+ val = fdt32_to_cpu (*sc);\r
+ if ((val < 0) || (val > FDT_MAX_NCELLS)) {\r
+ return -FDT_ERR_BADNCELLS;\r
+ }\r
\r
- return val;\r
+ return val;\r
}\r