New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 809829 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 8
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 849780



Sign in to add a comment

Build Chrome OS v4.14 kernel with clang

Project Member Reported by mka@chromium.org, Feb 7 2018

Issue description

v4.14 already has basic clang support, still need to fix compiler warnings and build errors, and verify there are no evident runtime issues.

Current list of target platforms: meowth, kahlee and cheza.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 7 2018

Labels: merge-merged-chromeos-4.14
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a5b089526060d7a9ea74b59308a98b77182f3fcd

commit a5b089526060d7a9ea74b59308a98b77182f3fcd
Author: Colin Ian King <colin.king@canonical.com>
Date: Wed Feb 07 08:43:45 2018

UPSTREAM: drm/amd/display: remove redundant null check of array 'data'

The null check on aconnector->base.edid_blob_ptr->data is redundant
since data is an array and can never be null.  Remove it.

Detected by CoverityScan, CID#1460369 ("Array compared against 0")

Acked-by: Christian Knig <christian.koenig@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a89ff457d6f6200cd58db568c0138988bb60579c)

BUG= chromium:809829 
TEST=USE="clang" emerge-kahlee  chromeos-kernel-4_14
  => no warning about checking 'data'

Change-Id: I551c932df2b45e75c9eae43b77b725d4ee10ac79
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905989
Commit-Ready: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>

[modify] https://crrev.com/a5b089526060d7a9ea74b59308a98b77182f3fcd/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Project Member

Comment 2 by bugdroid1@chromium.org, Feb 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/7112536e0f79d7b22436b57628de6d67ebe897d5

commit 7112536e0f79d7b22436b57628de6d67ebe897d5
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Thu Feb 08 05:27:22 2018

FROMGIT: drm/amd/powerplay: Fix enum mismatch

In several locations the driver uses AMD_CG_STATE_UNGATE (type enum
amd_clockgating_state) instead of AMD_PG_STATE_UNGATE (type enum
amd_powergating_stat) and vice versa. Both constants have the same
value, so this doesn't cause any problems, but we still want to pass
the correct type.

Fixing the mismatch resolves multiple warnings like this when building
with clang:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:169:7:
  error: implicit conversion from enumeration type 'enum
  amd_powergating_state' to different enumeration type 'enum
  amd_clockgating_state' [-Werror,-Wenum-conversion]
    AMD_PG_STATE_UNGATE);

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux drm-next-4.17-wip
commit 8717b5f6d321d2f5b481bfbed9b498e96f681a23)

BUG= chromium:809829 
TEST=build for kahlee

Change-Id: I93c5a66e10f2b7fe941e7138b3c8b8d5856cd9df
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/907638
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>

[modify] https://crrev.com/7112536e0f79d7b22436b57628de6d67ebe897d5/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c
[modify] https://crrev.com/7112536e0f79d7b22436b57628de6d67ebe897d5/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c

Project Member

Comment 3 by bugdroid1@chromium.org, Feb 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/127c438ff3674cda47cf1fa41204da112dbf9475

commit 127c438ff3674cda47cf1fa41204da112dbf9475
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Thu Feb 08 05:27:25 2018

FROMGIT: drm/amd/powerplay: Remove extra pair of parentheses

The double parentheses are not needed. Removing them fixes the following
warning when building with clang:

drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c:419:29:
  error: equality comparison with extraneous parentheses
    [-Werror,-Wparentheses-equality]
  if ((data->vdd_gfx_control == SMU7_VOLTAGE_CONTROL_BY_SVID2)) {

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux drm-next-4.17-wip
commit d5b8956f4199a1e6ce006f0402bfe4c9d578bc44)

BUG= chromium:809829 
TEST=build for kahlee

Change-Id: I1ce108d6d664d75ebf3232e00809c32179b4d034
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/907639
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>

[modify] https://crrev.com/127c438ff3674cda47cf1fa41204da112dbf9475/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c

Project Member

Comment 4 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e2348efcf2bc83bcb8bfcdbfaf12d6db0e1667cb

commit e2348efcf2bc83bcb8bfcdbfaf12d6db0e1667cb
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 03:43:37 2018

FROMGIT: drm/amd/display: Remove extra pairs of parentheses in dce_calcs.c

The double parentheses are not needed. Removing them fixes multiple
warnings like this when building with clang:

drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:617:42:
  error: equality comparison with extraneous parentheses
    [-Werror,-Wparentheses-equality]
  if ((data->graphics_micro_tile_mode == bw_def_rotated_micro_tiling)) {

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux drm-next-4.17-wip
commit e60096eb2392172e879585f42e20910e04f4bcbf)

BUG= chromium:809829 
TEST=USE="clang" emerge-kahlee chromeos-kernel-4_14
  => the warning in the commit message is not raised

Change-Id: If8e3c9aa5649ad38253eb95b13749f9c0181fead
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909713
Reviewed-by: Justin TerAvest <teravest@chromium.org>

[modify] https://crrev.com/e2348efcf2bc83bcb8bfcdbfaf12d6db0e1667cb/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

Project Member

Comment 5 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/b65ebf905521cf158d148ef0cf890bb4a35e14a2

commit b65ebf905521cf158d148ef0cf890bb4a35e14a2
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 03:43:40 2018

FROMGIT: amdgpu/dc: Fix enum mismatch in calls to program_color_matrix()

The driver passes GRAPHICS_CSC_ADJUST_TYPE_SW of type enum
graphics_csc_adjust_type to program_color_matrix(), however the function
expects a parameter of type enum grph_color_adjust_option. Supposedly
the intention was to pass GRPH_COLOR_MATRIX_SW, which has the same value
as GRAPHICS_CSC_ADJUST_TYPE_SW, so the mismatch didn't cause any trouble.

Pass GRPH_COLOR_MATRIX_SW to program_color_matrix() instead of
GRAPHICS_CSC_ADJUST_TYPE_SW, this also fixes the following warning when
building the kernel with clang:

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.c:1129:24:
  error: implicit conversion from enumeration type
  'enum graphics_csc_adjust_type' to different enumeration type
  'enum grph_color_adjust_option' [-Werror,-Wenum-conversion]
    xfm_dce, tbl_entry, GRAPHICS_CSC_ADJUST_TYPE_SW);

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux drm-next-4.17-wip
commit 87279e17ebfc2448e7e9eb3fa9ed0ff839bb01af)

BUG= chromium:809829 
TEST=USE="clang" emerge-kahlee chromeos-kernel-4_14
  => the warning in the commit message is not raised

Change-Id: I0ff5c667be604726723e7ec0493a7caf94bf333d
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909714
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>

[modify] https://crrev.com/b65ebf905521cf158d148ef0cf890bb4a35e14a2/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
[modify] https://crrev.com/b65ebf905521cf158d148ef0cf890bb4a35e14a2/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c

Project Member

Comment 6 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/95d568809c760fdbfe50bdbcaa407ab21f55b54c

commit 95d568809c760fdbfe50bdbcaa407ab21f55b54c
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 07:41:08 2018

FROMGIT: amdgpu/dc/dml: Consolidate redundant CFLAGS

Use a variable for common CFLAGS instead of specifying the same flags
for every source file.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

(cherry picked from people.freedesktop.org ~agd5f/linux amd-staging-drm-next
commit 3118594c28828efed2b86cfac3b3adebcabca568)

BUG= chromium:809829 
TEST=build for kahlee with clang

Conflicts:
	drivers/gpu/drm/amd/display/dc/dml/Makefile

Change-Id: Iffc78300d9f76d97fcb5bdcf64cc1a1401b07be8
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/910250
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/95d568809c760fdbfe50bdbcaa407ab21f55b54c/drivers/gpu/drm/amd/display/dc/dml/Makefile

Project Member

Comment 7 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/01e49c3de2b0459296add24ff441bf6257abdc41

commit 01e49c3de2b0459296add24ff441bf6257abdc41
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 07:41:11 2018

FROMGIT: amdgpu/dc/calcs: Consolidate redundant CFLAGS

Use a variable for common CFLAGS instead of specifying the same flags
for every source file.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux amd-staging-drm-next
commit 889923cc119f903db2f90c38c246f4dc7f8b905a)

BUG= chromium:809829 
TEST=build for kahlee with clang

Change-Id: Ibd92325c2cf4f9670991a5e42e52f4305d2d9627
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/910251
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/01e49c3de2b0459296add24ff441bf6257abdc41/drivers/gpu/drm/amd/display/dc/calcs/Makefile

Project Member

Comment 8 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1795a92b12012237bf37b7034368a6283e7c534e

commit 1795a92b12012237bf37b7034368a6283e7c534e
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 07:41:13 2018

FROMGIT: amdgpu/dc/dml: Support clang option for stack alignment

DML uses the compiler option -mpreferred-stack-boundary=4 to configure
a stack alignment of 16 bytes. Clang uses the option -mstack-alignment
instead, which expects as parameter the alignment in bytes, and not a
power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to
what is done in arch/x86/Makefile.

Reported-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
(cherry picked from
commit c73afced6a1550c2151b1f8de7effdaa997375f4)

BUG= chromium:809829  people.freedesktop.org ~agd5f/linux amd-staging-drm-next
TEST=build for kahlee with clang

Change-Id: Ic82082b5b7a3f26aa8126b747ee5f068a05217dd
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/910252
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/1795a92b12012237bf37b7034368a6283e7c534e/drivers/gpu/drm/amd/display/dc/dml/Makefile

Project Member

Comment 9 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c858bf2c7b25a0696c4342a5b2c52bdf5aacec68

commit c858bf2c7b25a0696c4342a5b2c52bdf5aacec68
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Feb 09 07:41:16 2018

FROMGIT: amdgpu/dc/calcs: Support clang option for stack alignment

calcs uses the compiler option -mpreferred-stack-boundary=4 to configure
a stack alignment of 16 bytes. Clang uses the option -mstack-alignment
instead, which expects as parameter the alignment in bytes, and not a
power of two like -mpreferred-stack-boundary.

Probe for both compiler options and use the correct one, similar to
what is done in arch/x86/Makefile.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
(cherry picked from people.freedesktop.org ~agd5f/linux amd-staging-drm-next
commit 20b99ba27025beb752e62d710b308802e79d46f1)

BUG= chromium:809829 
TEST=build for kahlee with clan

Change-Id: I00b0dc8455ab396ef3b090cf7548b0f7c470fdbd
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/910253
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/c858bf2c7b25a0696c4342a5b2c52bdf5aacec68/drivers/gpu/drm/amd/display/dc/calcs/Makefile

Project Member

Comment 10 by bugdroid1@chromium.org, Feb 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d245ce664da7c0ced2134b5b38bc332a3908b45a

commit d245ce664da7c0ced2134b5b38bc332a3908b45a
Author: Harry Wentland <harry.wentland@amd.com>
Date: Sat Feb 10 06:21:09 2018

UPSTREAM: drm/amd/display: Remove PSR functions in Linux

NULL check issue found by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:1976
dc_link_setup_psr() warn: variable dereferenced before check 'link' (see
line 1970)

We don't use these functions so might as well remove them.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 492c378aaa63e0ba65e6ee9645022e2b83703f25)

BUG= chromium:809829 
TEST=build for kahlee with clang

Change-Id: I567466bfdbea1e24e206d9d5e7365fc7e108a30f
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/912202
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d245ce664da7c0ced2134b5b38bc332a3908b45a/drivers/gpu/drm/amd/display/dc/core/dc_link.c

Project Member

Comment 11 by bugdroid1@chromium.org, Feb 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/a061e3b37f9cd872cad40000c484de23cc675d46

commit a061e3b37f9cd872cad40000c484de23cc675d46
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Tue Feb 20 21:14:08 2018

FROMLIST: amdgpu/dc: Remove unnecessary initialization in dc_link_handle_hpd_rx_irq()

The initialization of 'result' is unnecessary, the variable is assigned
unconditionally a few lines below. Removing the initialization also fixes
the following warning when building with clang:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1931:26:
  error: implicit conversion from enumeration type 'enum ddc_result'
  to different enumeration type 'enum dc_status' [-Werror,-Wenum-conversion]
    enum dc_status result = DDC_RESULT_UNKNOWN;

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>

Link: https://patchwork.freedesktop.org/patch/203776/

BUG= chromium:809829 
TEST=build for kahlee with clang

Change-Id: I29b1297779449c17e40240ae40bb143b88cf50ee
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/924525
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/a061e3b37f9cd872cad40000c484de23cc675d46/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/516d8f170d1fdc33182cd4f06e23365aec5c8fd3

commit 516d8f170d1fdc33182cd4f06e23365aec5c8fd3
Author: Harry Wentland <harry.wentland@amd.com>
Date: Tue Feb 20 21:14:11 2018

FROMLIST: drm/amd/display: Remove duplicate dm_pp_power_level enum

This is really just a copy of dm_pp_clocks_state, so just use that one.

Thanks to Matthias Kaehlke for spotting this.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>

Link: https://patchwork.freedesktop.org/patch/203765/

BUG= chromium:809829 
TEST=build for kahlee with clang

Change-Id: Ic3bd39d161cc0c909e820b33880fdf21736d0ab6
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/924526
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/516d8f170d1fdc33182cd4f06e23365aec5c8fd3/drivers/gpu/drm/amd/display/dc/dm_services_types.h

Project Member

Comment 13 by bugdroid1@chromium.org, Feb 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/23d8958a82d807c885b6bf8eea97ca00018e42c6

commit 23d8958a82d807c885b6bf8eea97ca00018e42c6
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Tue Feb 20 21:14:13 2018

FROMLIST: rtlwifi: rtl8192cu: Remove variable self-assignment in rf.c

In _rtl92c_get_txpower_writeval_by_regulatory() the variable writeVal
is assigned to itself in an if ... else statement, apparently only to
document that the branch condition is handled and that a previously read
value should be returned unmodified. The self-assignment causes clang to
raise the following warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c:304:13:
  error: explicitly assigning value of variable of type 'u32'
    (aka 'unsigned int') to itself [-Werror,-Wself-assign]
  writeVal = writeVal;

Delete the branch with the self-assignment.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Reviewed-by: Guenter Roeck <groeck@chromium.org>

Link: https://patchwork.kernel.org/patch/10208177/

BUG= chromium:809829 
TEST=build for kahlee with clang

Change-Id: I33a0a3bf627b154d8180a898e5d51a41c73df343
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/924527
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/23d8958a82d807c885b6bf8eea97ca00018e42c6/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c

Cc: furquan@chromium.org adurbin@chromium.org
Project Member

Comment 15 by bugdroid1@chromium.org, May 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1048e72698de784aed8b0c0951db8490b36863ce

commit 1048e72698de784aed8b0c0951db8490b36863ce
Author: Stefan Agner <stefan@agner.ch>
Date: Thu May 31 10:50:26 2018

UPSTREAM: drm/msm/dsi: use correct enum in dsi_get_cmd_fmt

The function dsi_get_cmd_fmt returns enum dsi_cmd_dst_format,
use the correct enum value also for MIPI_DSI_FMT_RGB666/_PACKED.

This has been discovered using clang:
  drivers/gpu/drm/msm/dsi/dsi_host.c:743:35: warning: implicit conversion
        from enumeration type 'enum dsi_vid_dst_format' to different
        enumeration type 'enum dsi_cmd_dst_format' [-Wenum-conversion]
          case MIPI_DSI_FMT_RGB666:       return VID_DST_FORMAT_RGB666;
                                          ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit a4af89286f8fc382459308764ea05935dc477cdc)

BUG= chromium:809829 
TEST=build for cheza with clang

Change-Id: Idf00df467a61f1e98b7e706ca9f229214b540b3b
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1079531
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>

[modify] https://crrev.com/1048e72698de784aed8b0c0951db8490b36863ce/drivers/gpu/drm/msm/dsi/dsi_host.c

chromeos-kernel-4_14 for grunt has some build issues:

USE="kasan clang" emerge-grunt -j chromeos-kernel-4_14
...
In file included from ../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/mmu.c:22:
In file included from ../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/mmu.h:6:
../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/kvm_cache_regs.h:44:32: error: implicit conversion from enumeration type 'enum kvm_reg_ex' to different enumeration type 'enum kvm_reg' [-Werror,-Wenum-conversion]
                kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR);
                ~~~~~~~~~~~                  ^~~~~~~~~~~~~~~~
../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/mmu.c:4266:39: error: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from -205 to 51 [-Werror,-Wconstant-conversion]
                u8 wf = (pfec & PFERR_WRITE_MASK) ? ~w : 0;
                   ~~                               ^~
../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/mmu.c:4268:38: error: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from -241 to 15 [-Werror,-Wconstant-conversion]
                u8 uf = (pfec & PFERR_USER_MASK) ? ~u : 0;
                   ~~                              ^~
../../../../../tmp/portage/sys-kernel/chromeos-kernel-4_14-4.14.43-r295/work/chromeos-kernel-4_14-4.14.43/arch/x86/kvm/mmu.c:4270:39: error: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from -171 to 85 [-Werror,-Wconstant-conversion]
                u8 ff = (pfec & PFERR_FETCH_MASK) ? ~x : 0;
                   ~~                               ^~
4 errors generated.


And some warnings:

net/xfrm/xfrm_ipcomp.o: warning: objtool: .text: unexpected end of section

drivers/net/wireless/marvell/libertas_tf/main.o: warning: objtool: lbtf_tx_work() falls through to next function lbtf_free_adapter()

drivers/net/wireless/ralink/rt2x00/rt2x00queue.o: warning: objtool: rt2x00queue_create_tx_descriptor() falls through to next function rt2x00queue_get_entry()

drivers/net/wireless/ath/ath5k/base.o: warning: objtool: ath5k_beacon_update() falls through to next function ath5k_beacon_update_timers()

That enum conversion warning was fixed by mka@ upstream in commit 1df372f473f6b2790c5a614c021d1accff97a9c0 "KVM: x86: Make enum conversion explicit in kvm_pdptr_read()"
I *think* the second was fixed upstream by commit 09f037aa48f34c84e70c5a6ef4870b2dee3aee76 "KVM: MMU: speedup update_permission_bitmask" from the KVM maintainer.  At least all variables there are u8 after that patch.

Comment 19 by mka@chromium.org, Jun 5 2018

Blockedon: 849780

Comment 20 by mka@chromium.org, Jun 5 2018

I'll integrate 1df372f473f6 "KVM: x86: Make enum conversion explicit in kvm_pdptr_read()"

For the implicit conversion problem I created  Issue 849780 .

The warnings about "falls through to next function" are related with the "ORC unwinder", I need to refresh my memory on that ...
Project Member

Comment 21 by bugdroid1@chromium.org, Jun 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/8ce7727e40cf7dcd0662703076407a7a9825c60a

commit 8ce7727e40cf7dcd0662703076407a7a9825c60a
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Thu Jun 07 15:36:01 2018

UPSTREAM: KVM: x86: Make enum conversion explicit in kvm_pdptr_read()

The type 'enum kvm_reg_ex' is an extension of 'enum kvm_reg', however
the extension is only semantical and the compiler doesn't know about the
relationship between the two types. In kvm_pdptr_read() a value of the
extended type is passed to kvm_x86_ops->cache_reg(), which expects a
value of the base type. Clang raises the following warning about the
type mismatch:

arch/x86/kvm/kvm_cache_regs.h:44:32: warning: implicit conversion from
  enumeration type 'enum kvm_reg_ex' to different enumeration type
  'enum kvm_reg' [-Wenum-conversion]
    kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR);

Cast VCPU_EXREG_PDPTR to 'enum kvm_reg' to make the compiler happy.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Radim Krm <rkrcmar@redhat.com>
(cherry picked from commit 1df372f473f6b2790c5a614c021d1accff97a9c0)

BUG= chromium:809829 
TEST=USE=clang emerge-grunt chromeos-kernel-4_14
  => no warning about enum mismatch in kvm_cache_regs.h

Change-Id: I836fa5469f1d2f16e4bf971b7eadd253d384293f
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1087388
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/8ce7727e40cf7dcd0662703076407a7a9825c60a/arch/x86/kvm/kvm_cache_regs.h

Comment 22 by mka@chromium.org, Jun 7 2018

#16: The "falls through to next function" warnings are likely instances of  Issue 824548 . A fix in LLVM should be available soon, I'll check if the warnings are still generated with the fix.
Project Member

Comment 23 by bugdroid1@chromium.org, Jun 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/8af3b3bcc8fb2e85f8381393b2b7f34f272d06ef

commit 8af3b3bcc8fb2e85f8381393b2b7f34f272d06ef
Author: Josh Poimboeuf <jpoimboe@redhat.com>
Date: Thu Jun 21 23:31:10 2018

FROMGIT: objtool: Add machine_real_restart() to the noreturn list

machine_real_restart() is annotated as '__noreturn", so add it to the
objtool noreturn list.  This fixes the following warning with clang and
CONFIG_CC_OPTIMIZE_FOR_SIZE=y:

  arch/x86/kernel/reboot.o: warning: objtool: native_machine_emergency_restart() falls through to next function machine_power_off()

Reported-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lkml.kernel.org/r/791712792aa4431bdd55bf1beb33a169ddf3b4a2.1529423255.git.jpoimboe@redhat.com

(cherry picked from commit 684fb246578b9e81fc7b4ca5c71eae22edb650b2
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/ core/urgent)

Conflicts:
  tools/objtool/check.c
    upstream commit b394d468e7d75 ("usercopy: Enhance and rename
    report_usercopy()") added usercopy_abort() to the list.

BUG= chromium:809829 
TEST=build for octopus with clang
  => builds without the above warning

Change-Id: If58f61850dd4216d6103f782065b19ff0b82269e
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1107276
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/8af3b3bcc8fb2e85f8381393b2b7f34f272d06ef/tools/objtool/check.c

Project Member

Comment 24 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/bcff60d490bac360766625bc6e2b0d5a4709664a

commit bcff60d490bac360766625bc6e2b0d5a4709664a
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Tue Jul 17 19:11:29 2018

CHROMIUM: Disable 'constant-conversion' warning for clang

There are only a few instances of this warning upstream, however there is
some resistance against fixing them. Disable the warning in our tree since
we treat warnings as errors.

BUG= chromium:809829 
TEST=build for grunt with clang
  => no 'constant-conversion' warnings

Change-Id: I66694a8a1a6fc63196ffca9374d48ccfb7d7f869
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1137347
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/bcff60d490bac360766625bc6e2b0d5a4709664a/Makefile

Project Member

Comment 25 by bugdroid1@chromium.org, Aug 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/db96cfe3921375f77fca544424b9591927f9c63c

commit db96cfe3921375f77fca544424b9591927f9c63c
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Aug 03 00:58:43 2018

UPSTREAM: x86/boot: Disable Clang warnings about GNU extensions

The kernel makes use of several GCC extensions, disable Clang warnings
about that in the boot code, as we already do for the rest of the kernel.

This suppresses the following warning when building with clang:

  ./include/linux/cgroup-defs.h:391:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
        struct cgroup cgrp;

Reported-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171030194351.122090-1-mka@chromium.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 6c3b56b1973083e2bb4e87eb90ea5368455706dc)

BUG= chromium:809829 
TEST=USE=clang FEATURES="noclean" cros_workon_make --board=octopus \
  --install chromeos-kernel-4_14
    => builds without the above warning

Change-Id: Ia10471b9c64334e1cf3de14e6f14d22906fcfd69
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1161053
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/db96cfe3921375f77fca544424b9591927f9c63c/arch/x86/boot/compressed/Makefile

Project Member

Comment 26 by bugdroid1@chromium.org, Aug 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/82fd2af89b2ba800c5f4853a19bbe3801f6d20fa

commit 82fd2af89b2ba800c5f4853a19bbe3801f6d20fa
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Wed Aug 08 04:44:54 2018

FROMLIST: ASoC: rt5677: Fix initialization of rt5677_of_match.data

The driver expects to find the device id in rt5677_of_match.data, however
it is currently assigned to rt5677_of_match.type. Fix this.

The problem was found with the help of clang:
  sound/soc/codecs/rt5677.c:5010:36: warning: expression which evaluates to
  zero treated as a null pointer constant of type 'const void *'
  [-Wnon-literal-null-conversion]
    { .compatible = "realtek,rt5677", RT5677 },
                                      ^~~~~~

Fixes: ddc9e69b9dc2 ("ASoC: rt5677: Hide platform data in the module sources")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
(am from https://lore.kernel.org/patchwork/patch/972359/)

BUG= chromium:809829 
TEST=USE=clang emerge-kukui chromeos-kernel-4_14
  => build successful

Change-Id: I97d645efa3ae617338da6e5ab481fcaba5e8b0e2
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1165584
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/82fd2af89b2ba800c5f4853a19bbe3801f6d20fa/sound/soc/codecs/rt5677.c

Project Member

Comment 27 by bugdroid1@chromium.org, Aug 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/3d00e3bbbee48d185761b633d3d6c0cd2eb64803

commit 3d00e3bbbee48d185761b633d3d6c0cd2eb64803
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Wed Aug 08 04:44:55 2018

chromeos-kernel-4_14: Build with clang

Switch all devices with a v4.14 kernel to use clang for kernel builds.

Testing performed:
 - grunt & octopus: basic sanity check of hardware interfaces
 - cheza: boots to UI
 - kukui: kernel builds

BUG= chromium:809829 
TEST=emerge-grunt chromeos-kernel-4_14
  ./update_kernel.sh --remote=${DUT}
  grep clang /proc/version
    => Linux version 4.14.y ... clang version x.y.z ...
CQ-DEPEND=CL:1165584

Change-Id: Ic6dcefa67b2db022a19273155f0c965d7ebedde2
Reviewed-on: https://chromium-review.googlesource.com/1165585
Commit-Ready: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>

[modify] https://crrev.com/3d00e3bbbee48d185761b633d3d6c0cd2eb64803/profiles/targets/chromeos/package.use

Status: Fixed (was: Assigned)
\m/

Sign in to add a comment