All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Ulrich Hecht <uli+renesas@fpond.eu>
Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
	davem@davemloft.net, linux-can@vger.kernel.org,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	biju.das.jz@bp.renesas.com, wsa@kernel.org,
	yoshihiro.shimoda.uh@renesas.com, wg@grandegger.com,
	kuba@kernel.org, mailhol.vincent@wanadoo.fr,
	socketcan@hartkopp.net, geert@linux-m68k.org,
	kieran.bingham@ideasonboard.com
Subject: Re: [PATCH v2 2/5] can: rcar_canfd: Add support for r8a779a0 SoC
Date: Wed, 12 Jan 2022 19:43:27 +0100	[thread overview]
Message-ID: <20220112184327.f7fwzgqvle23gfzv@pengutronix.de> (raw)
In-Reply-To: <20220111162231.10390-3-uli+renesas@fpond.eu>

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

On 11.01.2022 17:22:28, Ulrich Hecht wrote:
> Adds support for the CANFD IP variant in the V3U SoC.
> 
> Differences to controllers in other SoCs are limited to an increase in
> the number of channels from two to eight, an absence of dedicated
> registers for "classic" CAN mode, and a number of differences in magic
> numbers (register offsets and layouts).
> 
> Inspired by BSP patch by Kazuya Mizuguchi.
> 
> Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
> ---
>  drivers/net/can/rcar/rcar_canfd.c | 231 ++++++++++++++++++++----------
>  1 file changed, 153 insertions(+), 78 deletions(-)
> 
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index ff9d0f5ae0dd..b1c9870d2a82 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -44,10 +44,13 @@
>  enum rcanfd_chip_id {
>  	RENESAS_RCAR_GEN3 = 0,
>  	RENESAS_RZG2L,
> +	RENESAS_R8A779A0,
>  };
>  
>  /* Global register bits */
>  
> +#define IS_V3U (gpriv->chip_id == RENESAS_R8A779A0)

I really don't like this macro, as it silently relies on gpriv....and
I really don't like this use of this macro in the other macros that lead
to 2 or even 3 ternary operators hiding inside them. Is there any chance
to change this?

Please add at least the gpriv argument to IS_V3U().....

[...]

> -	of_child = of_get_child_by_name(pdev->dev.of_node, "channel1");
> -	if (of_child && of_device_is_available(of_child))
> -		channels_mask |= BIT(1);	/* Channel 1 */
> +	strcpy(name, "channelX");

please use strlcpy()

Marc

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-01-12 18:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 16:22 [PATCH v2 0/5] can: rcar_canfd: Add support for V3U flavor Ulrich Hecht
2022-01-11 16:22 ` [PATCH v2 1/5] clk: renesas: r8a779a0: add CANFD module clock Ulrich Hecht
2022-01-12  8:44   ` Geert Uytterhoeven
2022-01-12  8:55     ` Ulrich Hecht
2022-01-12 10:16       ` Geert Uytterhoeven
2022-01-11 16:22 ` [PATCH v2 2/5] can: rcar_canfd: Add support for r8a779a0 SoC Ulrich Hecht
2022-01-12 18:43   ` Marc Kleine-Budde [this message]
2022-01-13 16:44     ` Ulrich Hecht
2022-01-26 12:46     ` Geert Uytterhoeven
2022-01-31  2:08   ` Vincent MAILHOL
2022-01-31  9:24     ` Ulrich Hecht
2022-01-31 10:46       ` Vincent MAILHOL
2022-01-31 11:04   ` Vincent MAILHOL
2022-01-11 16:22 ` [PATCH v2 3/5] arm64: dts: renesas: r8a779a0: Add CANFD device node Ulrich Hecht
2022-01-26 13:11   ` Geert Uytterhoeven
2022-01-11 16:22 ` [PATCH v2 4/5] arm64: dts: renesas: r8a779a0-falcon: enable CANFD 0 and 1 Ulrich Hecht
2022-01-26 13:12   ` Geert Uytterhoeven
2022-01-11 16:22 ` [PATCH v2 5/5] dt-bindings: can: renesas,rcar-canfd: Document r8a779a0 support Ulrich Hecht
2022-01-26 13:13   ` Geert Uytterhoeven

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=20220112184327.f7fwzgqvle23gfzv@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=socketcan@hartkopp.net \
    --cc=uli+renesas@fpond.eu \
    --cc=wg@grandegger.com \
    --cc=wsa@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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.