All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <padovan@profusion.mobi>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] bluetooth: hci_ll: clean up types a bit
Date: Thu, 29 Sep 2011 16:28:47 -0300	[thread overview]
Message-ID: <20110929192847.GD2605@joana> (raw)
In-Reply-To: <20110926061412.GA11832@elgon.mountain>

Hi Dan,

* Dan Carpenter <dan.carpenter@oracle.com> [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?

	Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: Gustavo Padovan <padovan@profusion.mobi>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] bluetooth: hci_ll: clean up types a bit
Date: Thu, 29 Sep 2011 19:28:47 +0000	[thread overview]
Message-ID: <20110929192847.GD2605@joana> (raw)
In-Reply-To: <20110926061412.GA11832@elgon.mountain>

Hi Dan,

* Dan Carpenter <dan.carpenter@oracle.com> [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?

	Gustavo

  reply	other threads:[~2011-09-29 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26  6:14 [patch] bluetooth: hci_ll: clean up types a bit Dan Carpenter
2011-09-26  6:14 ` Dan Carpenter
2011-09-29 19:28 ` Gustavo Padovan [this message]
2011-09-29 19:28   ` Gustavo Padovan
2011-09-29 20:50   ` Dan Carpenter
2011-09-29 20:50     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110929192847.GD2605@joana \
    --to=padovan@profusion.mobi \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.