Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Unverified Commit 22c063da authored by Miles Chen's avatar Miles Chen Committed by Gagan Malvi
Browse files

display: mediatek: Remove const from utils



Currently some struct LCM_UTIL_FUNCS variable are mark as const
variable and should not be written. However, in we still cast
these variable to non-const pointer and write them.

Fix it by removing the const from these variables, so we can
modify these variables.

This issue is found by using clang-r370808:
"Writes to variables declared const through casts to non-const
pointers (explicitly undefined behavior) are now removed.
The next release of Clang adds UBSAN support for catching
such mistakes."

Variables:
static const struct LCM_UTIL_FUNCS lcm_utils_dsi0;
static const struct LCM_UTIL_FUNCS lcm_utils_dsi1;
static const struct LCM_UTIL_FUNCS lcm_utils_dsidual;

[163:disp_check]pc :           (null)
[163:disp_check]lr : lcm_suspend+0xc8/0xf4
[163:disp_check]sp : ffffff800c37bd10
[163:disp_check]x29: ffffff800c37bd10 x28: 000000000000fffc
[163:disp_check]x27: ffffff800a6de000 x26: 000000000000fffd
[163:disp_check]x25: ffffff800a6de000 x24: 000000000000fffb
[163:disp_check]x23: 0000000000000028 x22: ffffff800a6de000
[163:disp_check]x21: ffffff800956c04e x20: ffffff800992bcc5
[163:disp_check]x19: 0000000000000000 x18: ffffff8009876000
[163:disp_check]x17: 0000000000000000 x16: 0000000000000000
[163:disp_check]x15: 00000000000001f6 x14: 00000000000001f6
[163:disp_check]x13: 0000000000000004 x12: 0000000004a3fee0
[163:disp_check]x11: 843a0e2be8e0cd00 x10: 0000000000000001
[163:disp_check]x9 : 843a0e2be8e0cd00 x8 : 0000000000000000
[163:disp_check]x7 : ffffff800814c4ac x6 : 0000000000000000
[163:disp_check]x5 : 0000000000000080 x4 : 0000000000000001
[163:disp_check]x3 : ffffff800992bcc5 x2 : 0000000000000000
[164:disp_check]x1 : 0000000000000028 x0 : 0000000000000000
[163:disp_check]Call trace:
[163:disp_check]           (null)
[163:disp_check] disp_lcm_suspend+0x128/0x174
[163:disp_check] primary_display_esd_recovery+0x244/0x67c
[163:disp_check] primary_display_check_recovery_worker_kthread+0x1a4/0x350
[163:disp_check] kthread+0x118/0x128
[163:disp_check] ret_from_fork+0x10/0x18
[163:disp_check]Code: bad PC value
[163:disp_check]---[ end trace ffa1eb51d09561c6 ]---

Change-Id: I38be21d2b244622ce0c836a05994f148c813b8aa
Feature: [Module]Display Driver
Signed-off-by: default avatarMiles Chen <miles.chen@mediatek.com>
CR-Id: ALPS04988239
parent 6a737882
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment