All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: David Jander <david@protonic.nl>
Cc: linux-can@vger.kernel.org,
	Wolfgang Grandegger <wg@grandegger.com>,
	Alexander Stein <alexander.stein@systec-electronic.com>
Subject: Re: [PATCH 02/14] can: rx-fifo: Increase MB size limit from 32 to 64
Date: Thu, 06 Nov 2014 09:41:59 +0100	[thread overview]
Message-ID: <545B3457.9030207@pengutronix.de> (raw)
In-Reply-To: <1415262853-22907-3-git-send-email-david@protonic.nl>

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

On 11/06/2014 09:34 AM, David Jander wrote:
> Signed-off-by: David Jander <david@protonic.nl>
> ---
>  drivers/net/can/dev.c   | 24 ++++++++++++------------
>  include/linux/can/dev.h | 12 ++++++------
>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
> index c1e53e9..930b9f4 100644
> --- a/drivers/net/can/dev.c
> +++ b/drivers/net/can/dev.c
> @@ -289,20 +289,20 @@ static unsigned int can_rx_fifo_inc(struct can_rx_fifo *fifo, unsigned int *val)
>  		return (*val)--;
>  }
>  
> -static u32 can_rx_fifo_mask_low(struct can_rx_fifo *fifo)
> +static u64 can_rx_fifo_mask_low(struct can_rx_fifo *fifo)
>  {
>  	if (fifo->inc)
> -		return ~0U >> (32 + fifo->low_first - fifo->high_first) << fifo->low_first;
> +		return ~0LLU >> (64 + fifo->low_first - fifo->high_first) << fifo->low_first;
>  	else
> -		return ~0U >> (32 - fifo->low_first + fifo->high_first) << (fifo->high_first + 1);
> +		return ~0LLU >> (64 - fifo->low_first + fifo->high_first) << (fifo->high_first + 1);

Yesterday I stumbled over GENMASK_ULL
http://lxr.free-electrons.com/source/include/linux/bitops.h#L22
Does it make sense to use it here?

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-11-06 10:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  8:33 [PATCH V4 00/14] CAN: Add rx-fifo support and port flexcan to it David Jander
2014-11-06  8:34 ` [PATCH 01/14] can: dev: add preliminary rx-fifo David Jander
2014-11-06  8:34 ` [PATCH 02/14] can: rx-fifo: Increase MB size limit from 32 to 64 David Jander
2014-11-06  8:41   ` Marc Kleine-Budde [this message]
2014-11-06 16:03     ` David Jander
2014-11-06 16:05       ` Marc Kleine-Budde
2014-11-06 16:20         ` David Jander
2014-11-07  8:40           ` Marc Kleine-Budde
2014-11-07 10:28             ` David Jander
2014-11-06  8:34 ` [PATCH 03/14] can: rx-fifo: Change to do controller off-load in interrupt and NAPI poll David Jander
2014-11-10 11:00   ` David Jander
2014-11-06  8:34 ` [PATCH 04/14] can: rx-fifo: fix long lines David Jander
2014-11-06  8:34 ` [PATCH 05/14] can: rx-fifo: Add can_rx_fifo_reset() function David Jander
2014-11-06  8:34 ` [PATCH 06/14] can: rx-fifo: remove obsolete comment David Jander
2014-11-06  8:34 ` [PATCH 07/14] can: rx-fifo: Add support for can state tracking and error polling David Jander
2014-11-06  8:34 ` [PATCH 08/14] can: rx-fifo: Add support for simple irq offloading David Jander
2014-11-06  8:34 ` [PATCH 09/14] can: rx-fifo: Add documentation to struct can_rx_fifo David Jander
2014-11-06  8:34 ` [PATCH 10/14] can: flexcan: add documentation about mailbox organizaiton David Jander
2014-11-06  8:34 ` [PATCH 11/14] can: flexcan: rename crl2 -> ctrl2 David Jander
2014-11-06  8:34 ` [PATCH 12/14] can: flexcan: replace open coded mailbox code by proper defines David Jander
2014-11-06  8:34 ` [PATCH 13/14] can: flexcan: Add support for RX-FIFO David Jander
2014-11-06  8:34 ` [PATCH 14/14] can: flexcan: Add MB/Fifo specific column to comment table of IP versions David Jander

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=545B3457.9030207@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=alexander.stein@systec-electronic.com \
    --cc=david@protonic.nl \
    --cc=linux-can@vger.kernel.org \
    --cc=wg@grandegger.com \
    /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.