Re: [PATCH 2/2] Input: joystick - use sizeof(VARIABLE) in documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Dec 2013 01:51:41 -0800
Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:

> Hi Antonio,
> 
> On Mon, Dec 16, 2013 at 09:57:15AM +0100, Antonio Ospite wrote:
> > @@ -181,7 +181,7 @@ at a time using the typical read(2) functionality. For that, you would
> >  replace the read above with something like
> >  
> >  	struct js_event mybuffer[0xff];
> > -	int i = read (fd, mybuffer, sizeof(struct mybuffer));
> > +	int i = read (fd, mybuffer, ARRAY_SIZE(mybuffer));
> >  
> 
> This is wrong, as ARRAY_SIZE(mybuffer) would be 0xff and not the size of
> buffer in bytes. I'll fix it up.
> 
> Thanks.

You're right of course, thank you.

Ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux