lkml.org 
[lkml]   [2014]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] procfs: Drop cast
This patch does away with cast on void * and the if as it is unnecessary.

The following Coccinelle semantic patch was used for making the change:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
fs/proc/generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index b7f268e..f599d43 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -372,7 +372,7 @@ struct proc_dir_entry *proc_symlink(const char *name,
if (ent) {
ent->data = kmalloc((ent->size=strlen(dest))+1, GFP_KERNEL);
if (ent->data) {
- strcpy((char*)ent->data,dest);
+ strcpy(ent->data, dest);
if (proc_register(parent, ent) < 0) {
kfree(ent->data);
kfree(ent);
--
1.9.1


\
 
 \ /
  Last update: 2014-06-28 16:01    [W:2.506 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site