Re: [PATCH 2/2] staging/unisys/visorutil/procobjecttree: Replace typedef
From: Joe Perches
Date: Mon Feb 02 2015 - 13:32:11 EST
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...");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/