diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-02-25 02:47:10 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-26 12:43:47 -0500 |
commit | a65ecc4070c75ed53553def79e5da862b47daf1f (patch) | |
tree | 7e983deb716ca4f6c77165e129fbea52ee5e73f6 | |
parent | 70eacc72dbbc229013fee54550c03179f9a513d8 (diff) |
drm/amd: cleanup get_mfd_cell_dev()
It's simpler to just use snprintf() to print this to one buffer instead
of using strcpy() and strcat(). Also using snprintf() is slightly safer
than using sprintf().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index 9f8cfaab3004..d6b0bff510aa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |||
@@ -240,12 +240,10 @@ static int acp_poweron(struct generic_pm_domain *genpd) | |||
240 | static struct device *get_mfd_cell_dev(const char *device_name, int r) | 240 | static struct device *get_mfd_cell_dev(const char *device_name, int r) |
241 | { | 241 | { |
242 | char auto_dev_name[25]; | 242 | char auto_dev_name[25]; |
243 | char buf[8]; | ||
244 | struct device *dev; | 243 | struct device *dev; |
245 | 244 | ||
246 | sprintf(buf, ".%d.auto", r); | 245 | snprintf(auto_dev_name, sizeof(auto_dev_name), |
247 | strcpy(auto_dev_name, device_name); | 246 | "%s.%d.auto", device_name, r); |
248 | strcat(auto_dev_name, buf); | ||
249 | dev = bus_find_device_by_name(&platform_bus_type, NULL, auto_dev_name); | 247 | dev = bus_find_device_by_name(&platform_bus_type, NULL, auto_dev_name); |
250 | dev_info(dev, "device %s added to pm domain\n", auto_dev_name); | 248 | dev_info(dev, "device %s added to pm domain\n", auto_dev_name); |
251 | 249 | ||