diff mbox series

fbmem: Adjust indentation in fb_prepare_logo and fb_blank

Message ID 20191218030025.10064-1-natechancellor@gmail.com (mailing list archive)
State New, archived
Headers show
Series fbmem: Adjust indentation in fb_prepare_logo and fb_blank | expand

Commit Message

Nathan Chancellor Dec. 18, 2019, 3 a.m. UTC
Clang warns:

../drivers/video/fbdev/core/fbmem.c:665:3: warning: misleading
indentation; statement is not part of the previous 'else'
[-Wmisleading-indentation]
        if (fb_logo.depth > 4 && depth > 4) {
        ^
../drivers/video/fbdev/core/fbmem.c:661:2: note: previous statement is
here
        else
        ^
../drivers/video/fbdev/core/fbmem.c:1075:3: warning: misleading
indentation; statement is not part of the previous 'if'
[-Wmisleading-indentation]
        return ret;
        ^
../drivers/video/fbdev/core/fbmem.c:1072:2: note: previous statement is
here
        if (!ret)
        ^
2 warnings generated.

This warning occurs because there are spaces before the tabs on these
lines. Normalize the indentation in these functions so that it is
consistent with the Linux kernel coding style and clang no longer warns.

Fixes: 1692b37c99d5 ("fbdev: Fix logo if logo depth is less than framebuffer depth")
Link: https://github.com/ClangBuiltLinux/linux/issues/825
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/video/fbdev/core/fbmem.c | 36 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Comments

Nick Desaulniers Dec. 20, 2019, 6:09 p.m. UTC | #1
On Tue, Dec 17, 2019 at 7:00 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Clang warns:
>
> ../drivers/video/fbdev/core/fbmem.c:665:3: warning: misleading
> indentation; statement is not part of the previous 'else'
> [-Wmisleading-indentation]
>         if (fb_logo.depth > 4 && depth > 4) {
>         ^
> ../drivers/video/fbdev/core/fbmem.c:661:2: note: previous statement is
> here
>         else
>         ^
> ../drivers/video/fbdev/core/fbmem.c:1075:3: warning: misleading
> indentation; statement is not part of the previous 'if'
> [-Wmisleading-indentation]
>         return ret;
>         ^
> ../drivers/video/fbdev/core/fbmem.c:1072:2: note: previous statement is
> here
>         if (!ret)
>         ^
> 2 warnings generated.
>
> This warning occurs because there are spaces before the tabs on these
> lines. Normalize the indentation in these functions so that it is
> consistent with the Linux kernel coding style and clang no longer warns.
>
> Fixes: 1692b37c99d5 ("fbdev: Fix logo if logo depth is less than framebuffer depth")
> Link: https://github.com/ClangBuiltLinux/linux/issues/825
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/video/fbdev/core/fbmem.c | 36 ++++++++++++++++----------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index 0662b61fdb50..bf63cc0e6b65 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -662,20 +662,20 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
>                 fb_logo.depth = 1;
>
>
> -       if (fb_logo.depth > 4 && depth > 4) {
> -               switch (info->fix.visual) {
> -               case FB_VISUAL_TRUECOLOR:
> -                       fb_logo.needs_truepalette = 1;
> -                       break;
> -               case FB_VISUAL_DIRECTCOLOR:
> -                       fb_logo.needs_directpalette = 1;
> -                       fb_logo.needs_cmapreset = 1;
> -                       break;
> -               case FB_VISUAL_PSEUDOCOLOR:
> -                       fb_logo.needs_cmapreset = 1;
> -                       break;
> -               }
> -       }
> +       if (fb_logo.depth > 4 && depth > 4) {
> +               switch (info->fix.visual) {
> +               case FB_VISUAL_TRUECOLOR:
> +                       fb_logo.needs_truepalette = 1;
> +                       break;
> +               case FB_VISUAL_DIRECTCOLOR:
> +                       fb_logo.needs_directpalette = 1;
> +                       fb_logo.needs_cmapreset = 1;
> +                       break;
> +               case FB_VISUAL_PSEUDOCOLOR:
> +                       fb_logo.needs_cmapreset = 1;
> +                       break;
> +               }
> +       }
>
>         height = fb_logo.logo->height;
>         if (fb_center_logo)
> @@ -1060,19 +1060,19 @@ fb_blank(struct fb_info *info, int blank)
>         struct fb_event event;
>         int ret = -EINVAL;
>
> -       if (blank > FB_BLANK_POWERDOWN)
> -               blank = FB_BLANK_POWERDOWN;
> +       if (blank > FB_BLANK_POWERDOWN)
> +               blank = FB_BLANK_POWERDOWN;
>
>         event.info = info;
>         event.data = &blank;
>
>         if (info->fbops->fb_blank)
> -               ret = info->fbops->fb_blank(blank, info);
> +               ret = info->fbops->fb_blank(blank, info);
>
>         if (!ret)
>                 fb_notifier_call_chain(FB_EVENT_BLANK, &event);
>
> -       return ret;
> +       return ret;
>  }
>  EXPORT_SYMBOL(fb_blank);
>
> --
> 2.24.1
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20191218030025.10064-1-natechancellor%40gmail.com.
Bartlomiej Zolnierkiewicz Jan. 15, 2020, 4:01 p.m. UTC | #2
On 12/20/19 7:09 PM, Nick Desaulniers wrote:
> On Tue, Dec 17, 2019 at 7:00 PM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
>>
>> Clang warns:
>>
>> ../drivers/video/fbdev/core/fbmem.c:665:3: warning: misleading
>> indentation; statement is not part of the previous 'else'
>> [-Wmisleading-indentation]
>>         if (fb_logo.depth > 4 && depth > 4) {
>>         ^
>> ../drivers/video/fbdev/core/fbmem.c:661:2: note: previous statement is
>> here
>>         else
>>         ^
>> ../drivers/video/fbdev/core/fbmem.c:1075:3: warning: misleading
>> indentation; statement is not part of the previous 'if'
>> [-Wmisleading-indentation]
>>         return ret;
>>         ^
>> ../drivers/video/fbdev/core/fbmem.c:1072:2: note: previous statement is
>> here
>>         if (!ret)
>>         ^
>> 2 warnings generated.
>>
>> This warning occurs because there are spaces before the tabs on these
>> lines. Normalize the indentation in these functions so that it is
>> consistent with the Linux kernel coding style and clang no longer warns.
>>
>> Fixes: 1692b37c99d5 ("fbdev: Fix logo if logo depth is less than framebuffer depth")
>> Link: https://protect2.fireeye.com/url?k=6092966e-3d083fcd-60931d21-002590f5b904-0ba0d782b5b6272b&u=https://github.com/ClangBuiltLinux/linux/issues/825
>> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> 
> Thanks for the patch!
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Patch queued for v5.6, thanks.
 
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

>> ---
>>  drivers/video/fbdev/core/fbmem.c | 36 ++++++++++++++++----------------
>>  1 file changed, 18 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
>> index 0662b61fdb50..bf63cc0e6b65 100644
>> --- a/drivers/video/fbdev/core/fbmem.c
>> +++ b/drivers/video/fbdev/core/fbmem.c
>> @@ -662,20 +662,20 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
>>                 fb_logo.depth = 1;
>>
>>
>> -       if (fb_logo.depth > 4 && depth > 4) {
>> -               switch (info->fix.visual) {
>> -               case FB_VISUAL_TRUECOLOR:
>> -                       fb_logo.needs_truepalette = 1;
>> -                       break;
>> -               case FB_VISUAL_DIRECTCOLOR:
>> -                       fb_logo.needs_directpalette = 1;
>> -                       fb_logo.needs_cmapreset = 1;
>> -                       break;
>> -               case FB_VISUAL_PSEUDOCOLOR:
>> -                       fb_logo.needs_cmapreset = 1;
>> -                       break;
>> -               }
>> -       }
>> +       if (fb_logo.depth > 4 && depth > 4) {
>> +               switch (info->fix.visual) {
>> +               case FB_VISUAL_TRUECOLOR:
>> +                       fb_logo.needs_truepalette = 1;
>> +                       break;
>> +               case FB_VISUAL_DIRECTCOLOR:
>> +                       fb_logo.needs_directpalette = 1;
>> +                       fb_logo.needs_cmapreset = 1;
>> +                       break;
>> +               case FB_VISUAL_PSEUDOCOLOR:
>> +                       fb_logo.needs_cmapreset = 1;
>> +                       break;
>> +               }
>> +       }
>>
>>         height = fb_logo.logo->height;
>>         if (fb_center_logo)
>> @@ -1060,19 +1060,19 @@ fb_blank(struct fb_info *info, int blank)
>>         struct fb_event event;
>>         int ret = -EINVAL;
>>
>> -       if (blank > FB_BLANK_POWERDOWN)
>> -               blank = FB_BLANK_POWERDOWN;
>> +       if (blank > FB_BLANK_POWERDOWN)
>> +               blank = FB_BLANK_POWERDOWN;
>>
>>         event.info = info;
>>         event.data = &blank;
>>
>>         if (info->fbops->fb_blank)
>> -               ret = info->fbops->fb_blank(blank, info);
>> +               ret = info->fbops->fb_blank(blank, info);
>>
>>         if (!ret)
>>                 fb_notifier_call_chain(FB_EVENT_BLANK, &event);
>>
>> -       return ret;
>> +       return ret;
>>  }
>>  EXPORT_SYMBOL(fb_blank);
>>
>> --
>> 2.24.1
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
>> To view this discussion on the web visit https://protect2.fireeye.com/url?k=d7e70d81-8a7da422-d7e686ce-002590f5b904-15caafb1f7cc41ea&u=https://groups.google.com/d/msgid/clang-built-linux/20191218030025.10064-1-natechancellor%40gmail.com.
diff mbox series

Patch

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 0662b61fdb50..bf63cc0e6b65 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -662,20 +662,20 @@  int fb_prepare_logo(struct fb_info *info, int rotate)
 		fb_logo.depth = 1;
 
 
- 	if (fb_logo.depth > 4 && depth > 4) {
- 		switch (info->fix.visual) {
- 		case FB_VISUAL_TRUECOLOR:
- 			fb_logo.needs_truepalette = 1;
- 			break;
- 		case FB_VISUAL_DIRECTCOLOR:
- 			fb_logo.needs_directpalette = 1;
- 			fb_logo.needs_cmapreset = 1;
- 			break;
- 		case FB_VISUAL_PSEUDOCOLOR:
- 			fb_logo.needs_cmapreset = 1;
- 			break;
- 		}
- 	}
+	if (fb_logo.depth > 4 && depth > 4) {
+		switch (info->fix.visual) {
+		case FB_VISUAL_TRUECOLOR:
+			fb_logo.needs_truepalette = 1;
+			break;
+		case FB_VISUAL_DIRECTCOLOR:
+			fb_logo.needs_directpalette = 1;
+			fb_logo.needs_cmapreset = 1;
+			break;
+		case FB_VISUAL_PSEUDOCOLOR:
+			fb_logo.needs_cmapreset = 1;
+			break;
+		}
+	}
 
 	height = fb_logo.logo->height;
 	if (fb_center_logo)
@@ -1060,19 +1060,19 @@  fb_blank(struct fb_info *info, int blank)
 	struct fb_event event;
 	int ret = -EINVAL;
 
- 	if (blank > FB_BLANK_POWERDOWN)
- 		blank = FB_BLANK_POWERDOWN;
+	if (blank > FB_BLANK_POWERDOWN)
+		blank = FB_BLANK_POWERDOWN;
 
 	event.info = info;
 	event.data = &blank;
 
 	if (info->fbops->fb_blank)
- 		ret = info->fbops->fb_blank(blank, info);
+		ret = info->fbops->fb_blank(blank, info);
 
 	if (!ret)
 		fb_notifier_call_chain(FB_EVENT_BLANK, &event);
 
- 	return ret;
+	return ret;
 }
 EXPORT_SYMBOL(fb_blank);