All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Ulrich Hecht <uli+renesas@fpond.eu>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-can@vger.kernel.org, "Lad,
	Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Wolfram Sang <wsa@kernel.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	socketcan@hartkopp.net,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: Re: [PATCH v2 2/5] can: rcar_canfd: Add support for r8a779a0 SoC
Date: Wed, 26 Jan 2022 13:46:48 +0100	[thread overview]
Message-ID: <CAMuHMdWhRULedk1GCav+8=DMc9OqKTtuaG1XHNqxurF9S=s18w@mail.gmail.com> (raw)
In-Reply-To: <20220112184327.f7fwzgqvle23gfzv@pengutronix.de>

Hi Marc,

On Wed, Jan 12, 2022 at 7:43 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> 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>

> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c

> > -     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()

Why? To cause a silent failure instead of a possible crash, in the unlikely
case the buffer is shrinked or the string is enlarged?

What about preinitializing it at declaration time instead:

    char name[9] = "channelX";

?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2022-01-26 12:47 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
2022-01-13 16:44     ` Ulrich Hecht
2022-01-26 12:46     ` Geert Uytterhoeven [this message]
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='CAMuHMdWhRULedk1GCav+8=DMc9OqKTtuaG1XHNqxurF9S=s18w@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=davem@davemloft.net \
    --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=mkl@pengutronix.de \
    --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.