lkml.org 
[lkml]   [2003]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] add seq file helpers from 2.5 (fwd)
* Chris Wright (chris@wirex.com) wrote:
> * Marcelo Tosatti (marcelo@conectiva.com.br) wrote:
> > +int single_open(struct file *file, int (*show)(struct seq_file *, void*), void *data)
> > +{
> > + struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL);
> > + int res = -ENOMEM;
> > +
> > + if (op) {
> > + op->start = single_start;
> > + op->next = single_next;
> > + op->stop = single_stop;
> > + op->show = show;
> > + res = seq_open(file, op);
>
> Any reason not to simply allocate static ops struct? As in:

Bah, nevermind, I didn't look closely enough to see that show is
dynamic here (not to mention it is simple straight backport). Sorry for
senseless noise ;-)

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.035 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site