Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wuninitialized in drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c #1931

Closed
nathanchance opened this issue Sep 13, 2023 · 3 comments
Assignees
Labels
-Wuninitialized [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
  368 |                                                  new_payload, old_payload);
      |                                                               ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
  344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
      |                                                                    ^
      |                                                                     = NULL
1 error generated.

Patch submitted: https://lore.kernel.org/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org/

@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review -Wuninitialized [BUG] linux-next This is an issue only seen in linux-next labels Sep 13, 2023
@nathanchance nathanchance self-assigned this Sep 13, 2023
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 13, 2023
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux#1931
Fixes: 5aa1dfc ("drm/mst: Refactor the flow for payload allocation/removement")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Sep 13, 2023
@nathanchance
Copy link
Member Author

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Sep 13, 2023
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux#1931
Fixes: 5aa1dfc ("drm/mst: Refactor the flow for payload allocation/removement")
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Sep 14, 2023
jdpanderson pushed a commit to jdpanderson/linux that referenced this issue Oct 8, 2023
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux#1931
Fixes: 5aa1dfc ("drm/mst: Refactor the flow for payload allocation/removement")
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org
berolinux pushed a commit to OpenMandrivaSoftware/linux that referenced this issue Oct 30, 2023
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux#1931
Fixes: 5aa1dfc ("drm/mst: Refactor the flow for payload allocation/removement")
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org
lutzbichler pushed a commit to lutzbichler/drm-kmod that referenced this issue Feb 17, 2024
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux/linux#1931
Fixes: 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement")
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org
paralin pushed a commit to skiffos/linux that referenced this issue Apr 14, 2024
…d_allocation()

When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: ClangBuiltLinux#1931
Fixes: 5aa1dfc ("drm/mst: Refactor the flow for payload allocation/removement")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wuninitialized [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

2 participants