From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Subject: Re: [PATCH v4 4/5] can: bcm: add support for CAN FD frames
Date: Fri, 17 Jun 2016 12:37:37 +0200 [thread overview]
Message-ID: <5763D2F1.5040408@hartkopp.net> (raw)
In-Reply-To: <d37c690e-d872-cf25-b22c-7a6def80069f@pengutronix.de>
On 06/17/2016 12:23 PM, Marc Kleine-Budde wrote:
> On 06/04/2016 09:26 PM, Oliver Hartkopp wrote:
>> -/* easy access to CAN frame payload */
>> -static inline u64 GET_U64(const struct can_frame *cp)
>> +/* easy access to the first 64 bit of can(fd)_frame payload */
>> +static inline u64 GET_U64(const struct canfd_frame *cp, int offset)
>> {
>> - return *(u64 *)cp->data;
>> + return *(u64 *)(cp->data + offset);
>
> Can you ensure that offset is always a multiple of 8?
I would like to put that into a comment, as a check for this helper at
runtime is too expensive - and the caller is only in this C-file at two
places.
> Unaligned pointer
> access will be quite slow on some platforms.
cp->data is well aligned.
> Can you please make this
> function lower-case (as it's a function not a macro).
will do.
Tnx,
Oliver
next prev parent reply other threads:[~2016-06-17 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-04 19:26 [PATCH v4 0/5] Add support for CAN FD to broadcast manager (CAN_BCM) Oliver Hartkopp
2016-06-04 19:26 ` [PATCH v4 1/5] can: bcm: fix indention and other minor style issues Oliver Hartkopp
2016-06-04 19:26 ` [PATCH v4 2/5] can: bcm: use CAN frame instead of can_frame in comments Oliver Hartkopp
2016-06-04 19:26 ` [PATCH v4 3/5] can: bcm: unify bcm_msg_head handling and prepare function parameters Oliver Hartkopp
2016-06-04 19:26 ` [PATCH v4 4/5] can: bcm: add support for CAN FD frames Oliver Hartkopp
2016-06-17 10:23 ` Marc Kleine-Budde
2016-06-17 10:37 ` Oliver Hartkopp [this message]
2016-06-17 10:41 ` Marc Kleine-Budde
2016-06-04 19:26 ` [PATCH v4 5/5] can: bcm: add documentation for CAN FD support Oliver Hartkopp
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=5763D2F1.5040408@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/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.