lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef
From
Date
On Mon, 2015-02-02 at 19:26 +0100, Ricardo Ribalda Delgado wrote:
> Instead of declaring a new type, define a new struct.
[]
> diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c b/drivers/staging/unisys/visorutil/procobjecttree.c
[]
> @@ -340,7 +341,9 @@ EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
>
> static int seq_show(struct seq_file *seq, void *offset)
> {
> - PROCDIRENTRYCONTEXT *ctx = (PROCDIRENTRYCONTEXT *)(seq->private);
> + struct proc_dir_entry_context *ctx;
> +
> + ctx = (struct proc_dir_entry_context *)(seq->private);

seq-private is a void * and doesn't need to be cast here.

struct proc_dir_entry_context *ctx = seq->private;

should work well enough.

>
> if (ctx == NULL) {
> ERRDRV("I don't have a freakin' clue...");





\
 
 \ /
  Last update: 2015-02-02 19:41    [W:0.035 / U:3.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site