diff mbox

fw_cfg: follow CODING_STYLE

Message ID 1463569176-32122-1-git-send-email-caoj.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cao jin May 18, 2016, 10:59 a.m. UTC
Replace tab with 4 spaces; brace the indented statement.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 hw/nvram/fw_cfg.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Comments

Corey Minyard May 18, 2016, 2:36 p.m. UTC | #1
On 05/18/2016 05:59 AM, Cao jin wrote:
> Replace tab with 4 spaces; brace the indented statement.

Thanks, I think I have my editor set up to avoid the tab/space issue from
now on.  I'm going to have to handle kernel/qemu switching in my brain
for the brace issue.

Acked-by: Corey Minyard <cminyard@mvista.com>

> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>   hw/nvram/fw_cfg.c | 17 +++++++++++------
>   1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 999f480..826181a 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -728,15 +728,20 @@ static int get_fw_cfg_order(FWCfgState *s, const char *name)
>   {
>       int i;
>   
> -    if (s->fw_cfg_order_override > 0)
> -	return s->fw_cfg_order_override;
> +    if (s->fw_cfg_order_override > 0) {
> +        return s->fw_cfg_order_override;
> +    }
>   
>       for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {
> -	if (fw_cfg_order[i].name == NULL)
> -	    continue;
> -	if (strcmp(name, fw_cfg_order[i].name) == 0)
> -	    return fw_cfg_order[i].order;
> +        if (fw_cfg_order[i].name == NULL) {
> +            continue;
> +        }
> +
> +        if (strcmp(name, fw_cfg_order[i].name) == 0) {
> +            return fw_cfg_order[i].order;
> +        }
>       }
> +
>       /* Stick unknown stuff at the end. */
>       error_report("warning: Unknown firmware file in legacy mode: %s\n", name);
>       return FW_CFG_ORDER_OVERRIDE_LAST;
Markus Armbruster May 19, 2016, 12:40 p.m. UTC | #2
Corey Minyard <cminyard@mvista.com> writes:

> On 05/18/2016 05:59 AM, Cao jin wrote:
>> Replace tab with 4 spaces; brace the indented statement.
>
> Thanks, I think I have my editor set up to avoid the tab/space issue from
> now on.  I'm going to have to handle kernel/qemu switching in my brain
> for the brace issue.

You can outsource some of it to scripts/checkpatch.pl :)
Michael Tokarev May 29, 2016, 8:35 a.m. UTC | #3
18.05.2016 13:59, Cao jin wrote:
> Replace tab with 4 spaces; brace the indented statement.

Applied to -trivial, thanks!

/mjt
diff mbox

Patch

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 999f480..826181a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -728,15 +728,20 @@  static int get_fw_cfg_order(FWCfgState *s, const char *name)
 {
     int i;
 
-    if (s->fw_cfg_order_override > 0)
-	return s->fw_cfg_order_override;
+    if (s->fw_cfg_order_override > 0) {
+        return s->fw_cfg_order_override;
+    }
 
     for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {
-	if (fw_cfg_order[i].name == NULL)
-	    continue;
-	if (strcmp(name, fw_cfg_order[i].name) == 0)
-	    return fw_cfg_order[i].order;
+        if (fw_cfg_order[i].name == NULL) {
+            continue;
+        }
+
+        if (strcmp(name, fw_cfg_order[i].name) == 0) {
+            return fw_cfg_order[i].order;
+        }
     }
+
     /* Stick unknown stuff at the end. */
     error_report("warning: Unknown firmware file in legacy mode: %s\n", name);
     return FW_CFG_ORDER_OVERRIDE_LAST;