Commit 61b2db1d authored by Fancy Fang's avatar Fancy Fang

LF-335 drm/bridge: sec-dsim: solve fallthrough build warnings

There are some fallthrough build warnings reported by
the GCC with -Wimplicit-fallthrough option like below:

drivers/gpu/drm/bridge/sec-dsim.c: In function ‘sec_mipi_dsim_write_pl_to_sfr_fifo’:
drivers/gpu/drm/bridge/sec-dsim.c:606:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
  606 |   pl_data |= ((u8 *)payload)[2] << 16;
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/sec-dsim.c:607:2: note: here
  607 |  case 2:
      |  ^~~~
drivers/gpu/drm/bridge/sec-dsim.c:608:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
  608 |   pl_data |= ((u8 *)payload)[1] << 8;
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/sec-dsim.c:609:2: note: here
  609 |  case 1:
      |  ^~~~
drivers/gpu/drm/bridge/sec-dsim.c: In function ‘sec_mipi_dsim_read_pl_from_sfr_fifo’:
drivers/gpu/drm/bridge/sec-dsim.c:687:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
  687 |     ((u8 *)payload)[2] = (pl >> 16) & 0xff;
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/sec-dsim.c:688:4: note: here
  688 |    case 2:
      |    ^~~~
drivers/gpu/drm/bridge/sec-dsim.c:689:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
  689 |     ((u8 *)payload)[1] = (pl >> 8) & 0xff;
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/sec-dsim.c:690:4: note: here
  690 |    case 1:
      |    ^~~~
Signed-off-by: default avatarFancy Fang <chen.fang@nxp.com>
Reviewed-by: default avatarHaibo Chen <haibo.chen@nxp.com>
parent a3e29899
......@@ -604,8 +604,10 @@ static void sec_mipi_dsim_write_pl_to_sfr_fifo(struct sec_mipi_dsim *dsim,
switch (length) {
case 3:
pl_data |= ((u8 *)payload)[2] << 16;
/* fall through */
case 2:
pl_data |= ((u8 *)payload)[1] << 8;
/* fall through */
case 1:
pl_data |= ((u8 *)payload)[0];
dsim_write(dsim, pl_data, DSIM_PAYLOAD);
......@@ -685,8 +687,10 @@ static int sec_mipi_dsim_read_pl_from_sfr_fifo(struct sec_mipi_dsim *dsim,
switch (word_count) {
case 3:
((u8 *)payload)[2] = (pl >> 16) & 0xff;
/* fall through */
case 2:
((u8 *)payload)[1] = (pl >> 8) & 0xff;
/* fall through */
case 1:
((u8 *)payload)[0] = pl & 0xff;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment