]> Pileus Git - ~andy/linux/commitdiff
drm: simplify error printing in drm_debugfs_create_files
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Mon, 10 Oct 2011 17:34:57 +0000 (19:34 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 18 Oct 2011 09:20:34 +0000 (10:20 +0100)
There's no need to copy d_name.name.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_debugfs.c

index 9d2668a5087258e4f0624f69e40d9ccfbc989e0b..b9dc2629ea9aec5f8f7fd583be1e070e4871828f 100644 (file)
@@ -107,11 +107,8 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count,
                ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
                                          root, tmp, &drm_debugfs_fops);
                if (!ent) {
-                       char name[64];
-                       strncpy(name, root->d_name.name,
-                                               min(root->d_name.len, 64U));
                        DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n",
-                                 name, files[i].name);
+                                 root->d_name.name, files[i].name);
                        kfree(tmp);
                        ret = -1;
                        goto fail;