drm/radeon: Prefer strscpy over strlcpy calls in radeon_atombios.c
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 26 Jul 2023 14:56:30 +0000 (20:26 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jul 2023 19:05:32 +0000 (15:05 -0400)
Use the strscpy method instead of strlcpy method.

Fixes the below:

WARNING: Prefer strscpy over strlcpy

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_atombios.c

index 697a598..85c4bb1 100644 (file)
@@ -2105,7 +2105,7 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
                        const char *name = thermal_controller_names[power_info->info.
                                                                    ucOverdriveThermalController];
                        info.addr = power_info->info.ucOverdriveControllerAddress >> 1;
-                       strlcpy(info.type, name, sizeof(info.type));
+                       strscpy(info.type, name, sizeof(info.type));
                        i2c_new_client_device(&rdev->pm.i2c_bus->adapter, &info);
                }
        }
@@ -2355,7 +2355,7 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r
                                struct i2c_board_info info = { };
                                const char *name = pp_lib_thermal_controller_names[controller->ucType];
                                info.addr = controller->ucI2cAddress >> 1;
-                               strlcpy(info.type, name, sizeof(info.type));
+                               strscpy(info.type, name, sizeof(info.type));
                                i2c_new_client_device(&rdev->pm.i2c_bus->adapter, &info);
                        }
                } else {