lkml.org 
[lkml]   [2020]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 11/14] efi/gop: Allow specifying mode number on command line
On Fri, Mar 20, 2020 at 05:36:04PM +0300, Dan Carpenter wrote:
> Hi Arvind,
>
> Thank you for the patch! Perhaps something to improve:
>
> url: https://github.com/0day-ci/linux/commits/Arvind-Sankar/efi-gop-Refactoring-mode-setting-feature/20200320-044605
> base: https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> New smatch warnings:
> drivers/firmware/efi/libstub/gop.c:113 set_mode() error: uninitialized symbol 'new_mode'.
>
> # https://github.com/0day-ci/linux/commit/af85e496c9f577df9743784171b1cda94220dd8f
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout af85e496c9f577df9743784171b1cda94220dd8f
> vim +/info +85 drivers/firmware/efi/libstub/gop.c
>
> af85e496c9f577 Arvind Sankar 2020-03-19 97 static void set_mode(efi_graphics_output_protocol_t *gop)
> af85e496c9f577 Arvind Sankar 2020-03-19 98 {
> af85e496c9f577 Arvind Sankar 2020-03-19 99 efi_graphics_output_protocol_mode_t *mode;
> af85e496c9f577 Arvind Sankar 2020-03-19 100 u32 cur_mode, new_mode;
> af85e496c9f577 Arvind Sankar 2020-03-19 101
> af85e496c9f577 Arvind Sankar 2020-03-19 102 switch (cmdline.option) {
> af85e496c9f577 Arvind Sankar 2020-03-19 103 case EFI_CMDLINE_NONE:
> af85e496c9f577 Arvind Sankar 2020-03-19 104 return;
> af85e496c9f577 Arvind Sankar 2020-03-19 105 case EFI_CMDLINE_MODE_NUM:
> af85e496c9f577 Arvind Sankar 2020-03-19 106 new_mode = choose_mode_modenum(gop);
> af85e496c9f577 Arvind Sankar 2020-03-19 107 break;
>
> No default case?

Yeah, it's an enum with the only two values covered by the switch cases,
so it's really a bogus warning. I posted a v2 with a default case
instead anyway to silence it.

>
> af85e496c9f577 Arvind Sankar 2020-03-19 108 }
> af85e496c9f577 Arvind Sankar 2020-03-19 109
> af85e496c9f577 Arvind Sankar 2020-03-19 110 mode = efi_table_attr(gop, mode);
> af85e496c9f577 Arvind Sankar 2020-03-19 111 cur_mode = efi_table_attr(mode, mode);
> af85e496c9f577 Arvind Sankar 2020-03-19 112
> af85e496c9f577 Arvind Sankar 2020-03-19 @113 if (new_mode == cur_mode)
> af85e496c9f577 Arvind Sankar 2020-03-19 114 return;
> af85e496c9f577 Arvind Sankar 2020-03-19 115
> af85e496c9f577 Arvind Sankar 2020-03-19 116 if (efi_call_proto(gop, set_mode, new_mode) != EFI_SUCCESS)
> af85e496c9f577 Arvind Sankar 2020-03-19 117 efi_printk("Failed to set requested mode\n");
> af85e496c9f577 Arvind Sankar 2020-03-19 118 }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

\
 
 \ /
  Last update: 2020-03-20 18:52    [W:0.187 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site