* [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
@ 2020-07-07 14:07 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-07-07 14:07 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3608 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
head: d7f10c2411ed9283df8d763139de9468b88c89ce
commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
config: i386-randconfig-m021-20200703 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git remote update gustavoars-linux
git checkout 62708a516a6b158e213c46ff731260cb988dbc11
vim +492 drivers/gpu/drm/drm_dp_helper.c
7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
7529d6af1cd16b Mika Kahola 2016-09-09 466 {
7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
7529d6af1cd16b Mika Kahola 2016-09-09 471
7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 474
7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 481
7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
7529d6af1cd16b Mika Kahola 2016-09-09 491 }
62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
^^^^^^^^^^^
7529d6af1cd16b Mika Kahola 2016-09-09 493 default:
7529d6af1cd16b Mika Kahola 2016-09-09 494 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 495 }
7529d6af1cd16b Mika Kahola 2016-09-09 496 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34786 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
@ 2020-07-07 14:07 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-07-07 14:07 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3608 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
head: d7f10c2411ed9283df8d763139de9468b88c89ce
commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
config: i386-randconfig-m021-20200703 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git remote update gustavoars-linux
git checkout 62708a516a6b158e213c46ff731260cb988dbc11
vim +492 drivers/gpu/drm/drm_dp_helper.c
7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
7529d6af1cd16b Mika Kahola 2016-09-09 466 {
7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
7529d6af1cd16b Mika Kahola 2016-09-09 471
7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 474
7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 481
7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
7529d6af1cd16b Mika Kahola 2016-09-09 491 }
62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
^^^^^^^^^^^
7529d6af1cd16b Mika Kahola 2016-09-09 493 default:
7529d6af1cd16b Mika Kahola 2016-09-09 494 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 495 }
7529d6af1cd16b Mika Kahola 2016-09-09 496 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34786 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
2020-07-07 14:07 ` Dan Carpenter
(?)
@ 2020-07-07 15:25 ` Gustavo A. R. Silva
2020-07-07 17:19 ` Dan Carpenter
-1 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2020-07-07 15:25 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4030 bytes --]
Hi,
I think there is room for improvement here. Please, see my comments
below...
On Tue, Jul 07, 2020 at 05:07:17PM +0300, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
> head: d7f10c2411ed9283df8d763139de9468b88c89ce
> commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
> config: i386-randconfig-m021-20200703 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
>
> # https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
> git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
> git remote update gustavoars-linux
> git checkout 62708a516a6b158e213c46ff731260cb988dbc11
> vim +492 drivers/gpu/drm/drm_dp_helper.c
>
> 7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> 7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
> 7529d6af1cd16b Mika Kahola 2016-09-09 466 {
> 7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
> 7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> 7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
> 7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
> 7529d6af1cd16b Mika Kahola 2016-09-09 471
> 7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
> 7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
> 7529d6af1cd16b Mika Kahola 2016-09-09 474
> 7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
> 7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
> 7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
> 7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
> 7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
> 7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
> 7529d6af1cd16b Mika Kahola 2016-09-09 481
> 7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
> 7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
> 7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
> 7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
> 7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
> 7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
> 7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
> 7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
> 7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
> 7529d6af1cd16b Mika Kahola 2016-09-09 491 }
> 62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
> ^^^^^^^^^^^
Notice that the statement above and the code below is actually reachable
if _bpc_ doesn't match any of the switch cases.
Thanks
--
Gustavo
>
> 7529d6af1cd16b Mika Kahola 2016-09-09 493 default:
> 7529d6af1cd16b Mika Kahola 2016-09-09 494 return 0;
> 7529d6af1cd16b Mika Kahola 2016-09-09 495 }
> 7529d6af1cd16b Mika Kahola 2016-09-09 496 }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
2020-07-07 15:25 ` Gustavo A. R. Silva
@ 2020-07-07 17:19 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-07-07 17:19 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3959 bytes --]
On Tue, Jul 07, 2020 at 10:25:54AM -0500, Gustavo A. R. Silva wrote:
>
> Hi,
>
> I think there is room for improvement here. Please, see my comments
> below...
>
> On Tue, Jul 07, 2020 at 05:07:17PM +0300, Dan Carpenter wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
> > head: d7f10c2411ed9283df8d763139de9468b88c89ce
> > commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
> > config: i386-randconfig-m021-20200703 (attached as .config)
> > compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > smatch warnings:
> > drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
> >
> > # https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
> > git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
> > git remote update gustavoars-linux
> > git checkout 62708a516a6b158e213c46ff731260cb988dbc11
> > vim +492 drivers/gpu/drm/drm_dp_helper.c
> >
> > 7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > 7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
> > 7529d6af1cd16b Mika Kahola 2016-09-09 466 {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> > 7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 471
> > 7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
> > 7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 474
> > 7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 481
> > 7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 491 }
> > 62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
> > ^^^^^^^^^^^
>
> Notice that the statement above and the code below is actually reachable
> if _bpc_ doesn't match any of the switch cases.
There are only 4 possible cases and all of them are handled.
# define DP_DS_MAX_BPC_MASK (3 << 0)
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
@ 2020-07-07 17:19 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-07-07 17:19 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3959 bytes --]
On Tue, Jul 07, 2020 at 10:25:54AM -0500, Gustavo A. R. Silva wrote:
>
> Hi,
>
> I think there is room for improvement here. Please, see my comments
> below...
>
> On Tue, Jul 07, 2020 at 05:07:17PM +0300, Dan Carpenter wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
> > head: d7f10c2411ed9283df8d763139de9468b88c89ce
> > commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
> > config: i386-randconfig-m021-20200703 (attached as .config)
> > compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > smatch warnings:
> > drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
> >
> > # https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
> > git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
> > git remote update gustavoars-linux
> > git checkout 62708a516a6b158e213c46ff731260cb988dbc11
> > vim +492 drivers/gpu/drm/drm_dp_helper.c
> >
> > 7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > 7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
> > 7529d6af1cd16b Mika Kahola 2016-09-09 466 {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> > 7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 471
> > 7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
> > 7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 474
> > 7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 481
> > 7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
> > 7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
> > 7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
> > 7529d6af1cd16b Mika Kahola 2016-09-09 491 }
> > 62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
> > ^^^^^^^^^^^
>
> Notice that the statement above and the code below is actually reachable
> if _bpc_ doesn't match any of the switch cases.
There are only 4 possible cases and all of them are handled.
# define DP_DS_MAX_BPC_MASK (3 << 0)
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
@ 2020-07-03 16:09 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-07-03 16:09 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4561 bytes --]
CC: kbuild-all(a)lists.01.org
TO: "Gustavo A. R. Silva" <gustavoars@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fallthrough
head: d7f10c2411ed9283df8d763139de9468b88c89ce
commit: 62708a516a6b158e213c46ff731260cb988dbc11 [144/560] drm: Use fallthrough pseudo-keyword
:::::: branch date: 19 hours ago
:::::: commit date: 19 hours ago
config: i386-randconfig-m021-20200703 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code.
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=62708a516a6b158e213c46ff731260cb988dbc11
git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git remote update gustavoars-linux
git checkout 62708a516a6b158e213c46ff731260cb988dbc11
vim +492 drivers/gpu/drm/drm_dp_helper.c
1c29bd3d6011be Mika Kahola 2016-09-09 455
7529d6af1cd16b Mika Kahola 2016-09-09 456 /**
7529d6af1cd16b Mika Kahola 2016-09-09 457 * drm_dp_downstream_max_bpc() - extract branch device max
7529d6af1cd16b Mika Kahola 2016-09-09 458 * bits per component
7529d6af1cd16b Mika Kahola 2016-09-09 459 * @dpcd: DisplayPort configuration data
7529d6af1cd16b Mika Kahola 2016-09-09 460 * @port_cap: port capabilities
7529d6af1cd16b Mika Kahola 2016-09-09 461 *
7529d6af1cd16b Mika Kahola 2016-09-09 462 * Returns max bpc on success or 0 if max bpc not defined
7529d6af1cd16b Mika Kahola 2016-09-09 463 */
7529d6af1cd16b Mika Kahola 2016-09-09 464 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
7529d6af1cd16b Mika Kahola 2016-09-09 465 const u8 port_cap[4])
7529d6af1cd16b Mika Kahola 2016-09-09 466 {
7529d6af1cd16b Mika Kahola 2016-09-09 467 int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 468 bool detailed_cap_info = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
7529d6af1cd16b Mika Kahola 2016-09-09 469 DP_DETAILED_CAP_INFO_AVAILABLE;
7529d6af1cd16b Mika Kahola 2016-09-09 470 int bpc;
7529d6af1cd16b Mika Kahola 2016-09-09 471
7529d6af1cd16b Mika Kahola 2016-09-09 472 if (!detailed_cap_info)
7529d6af1cd16b Mika Kahola 2016-09-09 473 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 474
7529d6af1cd16b Mika Kahola 2016-09-09 475 switch (type) {
7529d6af1cd16b Mika Kahola 2016-09-09 476 case DP_DS_PORT_TYPE_VGA:
7529d6af1cd16b Mika Kahola 2016-09-09 477 case DP_DS_PORT_TYPE_DVI:
7529d6af1cd16b Mika Kahola 2016-09-09 478 case DP_DS_PORT_TYPE_HDMI:
7529d6af1cd16b Mika Kahola 2016-09-09 479 case DP_DS_PORT_TYPE_DP_DUALMODE:
7529d6af1cd16b Mika Kahola 2016-09-09 480 bpc = port_cap[2] & DP_DS_MAX_BPC_MASK;
7529d6af1cd16b Mika Kahola 2016-09-09 481
7529d6af1cd16b Mika Kahola 2016-09-09 482 switch (bpc) {
7529d6af1cd16b Mika Kahola 2016-09-09 483 case DP_DS_8BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 484 return 8;
7529d6af1cd16b Mika Kahola 2016-09-09 485 case DP_DS_10BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 486 return 10;
7529d6af1cd16b Mika Kahola 2016-09-09 487 case DP_DS_12BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 488 return 12;
7529d6af1cd16b Mika Kahola 2016-09-09 489 case DP_DS_16BPC:
7529d6af1cd16b Mika Kahola 2016-09-09 490 return 16;
7529d6af1cd16b Mika Kahola 2016-09-09 491 }
62708a516a6b15 Gustavo A. R. Silva 2020-07-02 @492 fallthrough;
7529d6af1cd16b Mika Kahola 2016-09-09 493 default:
7529d6af1cd16b Mika Kahola 2016-09-09 494 return 0;
7529d6af1cd16b Mika Kahola 2016-09-09 495 }
7529d6af1cd16b Mika Kahola 2016-09-09 496 }
7529d6af1cd16b Mika Kahola 2016-09-09 497 EXPORT_SYMBOL(drm_dp_downstream_max_bpc);
7529d6af1cd16b Mika Kahola 2016-09-09 498
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34786 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-07-07 17:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 14:07 [gustavoars-linux:testing/fallthrough 144/560] drivers/gpu/drm/drm_dp_helper.c:492 drm_dp_downstream_max_bpc() warn: ignoring unreachable code Dan Carpenter
2020-07-07 14:07 ` Dan Carpenter
2020-07-07 15:25 ` Gustavo A. R. Silva
2020-07-07 17:19 ` Dan Carpenter
2020-07-07 17:19 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2020-07-03 16:09 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.