[REFACTOR] sspt_proc_find_file_or_new()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 14 Jun 2013 08:28:48 +0000 (12:28 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 14 Jun 2013 08:28:48 +0000 (12:28 +0400)
us_manager/sspt/sspt_proc.c

index fa3cb5b..5d5aec6 100644 (file)
@@ -131,15 +131,12 @@ struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc,
 {
        struct sspt_file *file;
 
-       list_for_each_entry(file, &proc->file_list, list) {
-               if (file->dentry == dentry) {
-                       return file;
-               }
+       file = sspt_proc_find_file(proc, dentry);
+       if (file == NULL) {
+               file = sspt_file_create(name, dentry, 10);
+               sspt_proc_add_file(proc, file);
        }
 
-       file = sspt_file_create(name, dentry, 10);
-       sspt_proc_add_file(proc, file);
-
        return file;
 }