xen: remove unnecessary (void*) conversions (fwd)]
PATCH 1/1 xen: remove unnecessary (void*) conversions (fwd)]
Hi All,
Just wanted to re-run this useful advise from Julia earlier on some useful improvement opportunities.
Thank you Julia for the initial recommendation.
Deepak.
----- Forwarded message from Julia Lawall <[email protected]> -----
Date: Thu, 16 Mar 2023 09:48:02 +0100 (CET)
From: Julia Lawall <[email protected]>
To: [email protected]
Subject: [PATCH] xen: remove unnecessary (void*) conversions (fwd)
There may be some opportunities for this kind of change in staging.
julia
---------- Forwarded message ----------
Date: Thu, 16 Mar 2023 16:39:54 +0800
From: Yu Zhe <[email protected]>
To: [email protected], [email protected], [email protected]
Cc: [email protected], [email protected],
[email protected], [email protected],
Yu Zhe <[email protected]>
Subject: [PATCH] xen: remove unnecessary (void*) conversions
Pointer variables of void * type do not require type cast.
--- drivers/xen/xenfs/xensyms.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/xen/xenfs/xensyms.c +5 -5
@@ -64,7 +64,7 @@ static int xensyms_next_sym(struct xensyms *xs)static void *xensyms_start (struct seq_file *m,loff_t *pos) { -struct xensyms *xs = (struct xensyms *)m->private; +struct xensyms *xs = m->private; xs->op.u.symdata.symnum = *pos;
@@ -76,7 +76,7 @@ static void *xensyms_start(struct seq_file *m, loff_t *pos)static void *xensyms_next (struct seq_file *m,void *p,loff_t *pos) { -struct xensyms *xs = (struct xensyms *)m->private; +struct xensyms *xs = m->private; xs->op.u.symdata.symnum = ++(*pos);
@@ -88,7 +88,7 @@ static void *xensyms_next(struct seq_file *m, void *p, loff_t *pos)static int xensyms_show (struct seq_file *m,void *p) { -struct xensyms *xs = (struct xensyms *)m->private; +struct xensyms *xs = m->private;struct xenpf_symdata *symdata = &xs->op.u.symdata; seq_printf(m, "%016llx %c %s\n", symdata->address,
@@ -120,7 +120,7 @@ static int xensyms_open(struct inode *inode, struct file *file)return ret; m = file->private_data; - xs = (struct xensyms *)m->private; + xs = m->private; xs->namelen =XEN_KSYM_NAME_LEN +1 ; xs->name =kzalloc (xs->namelen,GFP_KERNEL );
@@ -138,7 +138,7 @@ static int xensyms_open(struct inode *inode, struct file *file)static int xensyms_release (struct inode *inode,struct file *file) {struct seq_file *m = file->private_data; -struct xensyms *xs = (struct xensyms *)m->private; +struct xensyms *xs = m->private;kfree (xs->name);return seq_release_private (inode, file);
Signature · 5 lines
2.11.0 ----- End forwarded message -----