]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
accel/habanalabs/goya: remove redundant assignment to pointer 'input'
authorColin Ian King <colin.i.king@intel.com>
Sat, 6 Jan 2024 12:42:13 +0000 (12:42 +0000)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 26 Feb 2024 07:30:40 +0000 (09:30 +0200)
The pointer input is assigned a value that is not read, it is
being re-assigned again later with the same value. Resolve this
by moving the declaration to input into the if block.

Cleans up clang scan build warning:
warning: Value stored to 'input' during its initialization is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/goya/goya_coresight.c

index 41cae5fd843b88bf3de894444281a227f9acd492..3827ea4c02f740a6c9ec73c41f77a09bcf35ef51 100644 (file)
@@ -576,7 +576,6 @@ static int goya_config_spmu(struct hl_device *hdev,
                struct hl_debug_params *params)
 {
        u64 base_reg;
-       struct hl_debug_params_spmu *input = params->input;
        u64 *output;
        u32 output_arr_len;
        u32 events_num;
@@ -592,7 +591,7 @@ static int goya_config_spmu(struct hl_device *hdev,
        base_reg = debug_spmu_regs[params->reg_idx] - CFG_BASE;
 
        if (params->enable) {
-               input = params->input;
+               struct hl_debug_params_spmu *input = params->input;
 
                if (!input)
                        return -EINVAL;