<p dir="ltr"><br>
El 19/04/2014 18:52, "L. Alberto Giménez" <<a href="mailto:agimenez@sysvalve.es">agimenez@sysvalve.es</a>> escribió:<br>
><br>
> On Fri, Apr 18, 2014 at 02:35:53PM -0700, Greg KH wrote:<br>
> > On Fri, Apr 18, 2014 at 06:30:44PM -0300, Aldo Esteban Paz wrote:<br>
> > > For the Eudyptula's Chanllenge Task 6, i need to write a misc device<br>
> > > driver with simple read/write operations.<br>
> > > The following was the answer to part of my code:<br>
> > ><br>
> > > > static char eid[] = EUDYPTULAID;<br>
> > > ><br>
> > > > static ssize_t misc_device_read(struct file *file, char __user *buf,<br>
> > > > size_t count, loff_t *ppos)<br>
> > > > {<br>
> > > > if (*ppos == sizeof(eid))<br>
> > > > return 0;<br>
> > > > else<br>
> > > > if (*ppos != 0 || count < sizeof(eid))<br>
> > > > return -EINVAL;<br>
> > > ><br>
> > > > if (copy_to_user(buf, eid, sizeof(eid)))<br>
> > > > return -EINVAL;<br>
> > > ><br>
> > > > *ppos = sizeof(eid);<br>
> > > ><br>
> > > > return *ppos;<br>
> > > > }<br>
> > ><br>
> > > This whole function can be made much more "simple" and reduced to one<br>
> > > single line {hint} (It's just a "simple" function call {hint}).<br>
> > ><br>
> > > Anyone know that "single" function?<br>
> ><br>
> > Yes, but you really should do your own research for stuff like this,<br>
> > that's what the challenge is all about, not asking others to do it for<br>
> > you :(<br>
><br>
> I'm curious about this. I didn't get the simple, one-line function call feedback and<br>
> my task was accepted with a regular function definition, similar to the one from the<br>
> OP.</p>
<p dir="ltr">That feedback may come in the next tasks ;)</p>
<p dir="ltr">><br>
> --<br>
> L. Alberto Giménez<br>
> GnuPG key ID 0xDD4E27AB<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>