From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH 1/6] canfd: add new data structures and constants
Date: Mon, 18 Jun 2012 21:48:36 +0200 [thread overview]
Message-ID: <4FDF8614.9040707@pengutronix.de> (raw)
In-Reply-To: <4FDF7F25.8040605@hartkopp.net>
[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]
On 06/18/2012 09:19 PM, Oliver Hartkopp wrote:
> On 18.06.2012 21:13, Marc Kleine-Budde wrote:
>
>> On 06/18/2012 07:39 PM, Oliver Hartkopp wrote:
>>> - add new struct canfd_frame
>
>>> struct can_frame {
>>> canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
>>> - __u8 can_dlc; /* data length code: 0 .. 8 */
>>> + __u8 can_dlc; /* frame payload length in byte (0 .. 8) */
>>> __u8 data[8] __attribute__((aligned(8)));
>>
>> checkpatch complains:
>>
>> WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
>> #84: FILE: include/linux/can.h:102:
>> + __u8 data[64] __attribute__((aligned(8)));
>>
>> total: 0 errors, 1 warnings, 97 lines checked
> Hm, yes. I wanted to have it the same way as in struct can_frame.
> I wonder if "__aligened(size)" is also compatible for backports - or
> alternative if we should also modify the original can_frame:
__aligened(size) has been introduced in v2.6.21-rc1~91^2~274.
(How to figure out:
$ git blame include/linux/compiler-gcc.h
$ git describe 82ddcb04
v2.6.20-1507-g82ddcb0
$ git describe --contains 82ddcb04
v2.6.21-rc1~91^2~274
)
>>> - __u8 data[8] __attribute__((aligned(8)));
>>> + __u8 data[8] __aligned(8);
If you want to be super clean you can first make a patch that changes
the existing __attribute__((aligned(8))) to __aligned(8), and then add
your canfd series. If not, just mention it in the patch description
(While being here change can_fd to __aligned(8)).
Err..this is a userspace header, I just tested it, headers_install
doesn't remove it. And userspace fails to compile with this. For now
stick to __attribute__((aligned(8))).
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: 262 bytes --]
next prev parent reply other threads:[~2012-06-18 19:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 17:39 [PATCH 1/6] canfd: add new data structures and constants Oliver Hartkopp
2012-06-18 17:51 ` Oliver Hartkopp
2012-06-18 19:12 ` Marc Kleine-Budde
2012-06-18 19:13 ` Marc Kleine-Budde
2012-06-18 19:19 ` Oliver Hartkopp
2012-06-18 19:48 ` Marc Kleine-Budde [this message]
2012-06-18 19:55 ` Marc Kleine-Budde
2012-06-18 20:03 ` Oliver Hartkopp
2012-06-18 20:20 ` Marc Kleine-Budde
2012-06-19 6:45 ` Wolfgang Grandegger
2012-06-19 7:11 ` Oliver Hartkopp
2012-06-19 7:28 ` Wolfgang Grandegger
2012-06-19 7:39 ` Oliver Hartkopp
2012-06-19 9:30 ` 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=4FDF8614.9040707@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).