Re: [patch] bluetooth: hci_ll: clean up types a bit

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

 



On Thu, Sep 29, 2011 at 04:28:47PM -0300, Gustavo Padovan wrote:
> Hi Dan,
> 
> * Dan Carpenter <dan.carpenter@xxxxxxxxxx> [2011-09-26 09:14:12 +0300]:
> 
> > I'm doing an audit of places where min_t() casting truncates a
> > variable such as:
> > 	len = min_t(unsigned int, ll->rx_count, count);
> > Here ll->rx_count is unsigned long, but we cast it to unsigned int
> > and lose the significant bits.
> > 
> > Looking at the code ->rx_count is never more than 256 so we could
> > just make it an int.
> 
> Where is this 256 maximum? I'm not seeing it?
> 

I'm sorry for this, I was wrong.  I'm not sure where I got that...
I can see at least one place where it goes up to USHRT_MAX in
the case of HCILL_W4_ACL_HDR.

I still think the patch is basically correct, but let me take another
look and resend with an updated commit message.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux