2023-07-18 02:15:02

by shijie001

[permalink] [raw]
Subject: [PATCH] scripts/dtc: Fix errors in yamltree.c

The following checkpatch errors are removed:
ERROR: "(foo*)" should be "(foo *)"

Signed-off-by: Jie Shi <[email protected]>
---
scripts/dtc/yamltree.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/dtc/yamltree.c b/scripts/dtc/yamltree.c
index 55908c829c98..dd22858d1bb1 100644
--- a/scripts/dtc/yamltree.c
+++ b/scripts/dtc/yamltree.c
@@ -57,7 +57,7 @@ static void yaml_propval_int(yaml_emitter_t *emitter,
struct marker *markers,

switch(width) {
case 1:
- sprintf(buf, "0x%"PRIx8, *(uint8_t*)(data + off));
+ sprintf(buf, "0x%"PRIx8, *(uint8_t *)(data + off));
break;
case 2:
sprintf(buf, "0x%"PRIx16, dtb_ld16(data + off));
@@ -80,11 +80,11 @@ static void yaml_propval_int(yaml_emitter_t
*emitter, struct marker *markers,

if (is_phandle)
yaml_scalar_event_initialize(&event, NULL,
- (yaml_char_t*)"!phandle", (yaml_char_t *)buf,
+ (yaml_char_t *)"!phandle", (yaml_char_t *)buf,
strlen(buf), 0, 0, YAML_PLAIN_SCALAR_STYLE);
else
yaml_scalar_event_initialize(&event, NULL,
- (yaml_char_t*)YAML_INT_TAG, (yaml_char_t *)buf,
+ (yaml_char_t *)YAML_INT_TAG, (yaml_char_t *)buf,
strlen(buf), 1, 1, YAML_PLAIN_SCALAR_STYLE);
yaml_emitter_emit_or_die(emitter, &event);
}
@@ -119,7 +119,7 @@ static void yaml_propval(yaml_emitter_t *emitter,
struct property *prop)

/* Emit the property name */
yaml_scalar_event_initialize(&event, NULL,
- (yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)prop->name,
+ (yaml_char_t *)YAML_STR_TAG, (yaml_char_t *)prop->name,
strlen(prop->name), 1, 1, YAML_PLAIN_SCALAR_STYLE);
yaml_emitter_emit_or_die(emitter, &event);

@@ -127,7 +127,7 @@ static void yaml_propval(yaml_emitter_t *emitter,
struct property *prop)
if (len == 0) {
yaml_scalar_event_initialize(&event, NULL,
(yaml_char_t *)YAML_BOOL_TAG,
- (yaml_char_t*)"true",
+ (yaml_char_t *)"true",
strlen("true"), 1, 0, YAML_PLAIN_SCALAR_STYLE);
yaml_emitter_emit_or_die(emitter, &event);
return;
@@ -194,7 +194,7 @@ static void yaml_tree(struct node *tree,
yaml_emitter_t *emitter)
/* Loop over all the children, emitting them into the map */
for_each_child(tree, child) {
yaml_scalar_event_initialize(&event, NULL,
- (yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)child->name,
+ (yaml_char_t *)YAML_STR_TAG, (yaml_char_t *)child->name,
strlen(child->name), 1, 0, YAML_PLAIN_SCALAR_STYLE);
yaml_emitter_emit_or_die(emitter, &event);
yaml_tree(child, emitter);


2023-07-18 13:59:04

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] scripts/dtc: Fix errors in yamltree.c

On Mon, Jul 17, 2023 at 7:38 PM <[email protected]> wrote:
>
> The following checkpatch errors are removed:
> ERROR: "(foo*)" should be "(foo *)"
>
> Signed-off-by: Jie Shi <[email protected]>
> ---
> scripts/dtc/yamltree.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)

This is a copy of upstream dtc imported as-is into the kernel. If you
want to make changes, you have to do them on the upstream dtc.

The YAML support is likely going to be removed, so I wouldn't bother
with style fixes.

Rob