From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Mon, 20 Jan 2014 12:12:53 +0000 Subject: Re: [PATCH v5] can: add Renesas R-Car CAN driver Message-Id: <52DD12C5.1070607@cogentembedded.com> List-Id: References: <201312270037.15822.sergei.shtylyov@cogentembedded.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Geert Uytterhoeven Cc: "netdev@vger.kernel.org" , wg@grandegger.com, mkl@pengutronix.de, linux-can@vger.kernel.org, Linux-sh list , vksavl@gmail.com Hello. On 20-01-2014 15:43, Geert Uytterhoeven wrote: >> Changes in version 3: >> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs'; >> - removed unneeded type cast in the probe() method. >> +/* Mailbox registers structure */ >> +struct rcar_can_mbox_regs { >> + u32 id; /* IDE and RTR bits, SID and EID */ >> + u8 stub; /* Not used */ >> + u8 dlc; /* Data Length Code - bits [0..3] */ >> + u8 data[8]; /* Data Bytes */ >> + u8 tsh; /* Time Stamp Higher Byte */ >> + u8 tsl; /* Time Stamp Lower Byte */ >> +} __packed; > Sorry, I missed the earlier discussion, but why the _packed? > One u32 and 12 bytes makes a nice multiple of 4. Mainly for consistency as this is a structure representing the hardware registers. > Gr{oetje,eeting}s, > Geert WBR, Sergei From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH v5] can: add Renesas R-Car CAN driver Date: Mon, 20 Jan 2014 16:12:53 +0400 Message-ID: <52DD12C5.1070607@cogentembedded.com> References: <201312270037.15822.sergei.shtylyov@cogentembedded.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-sh-owner@vger.kernel.org To: Geert Uytterhoeven Cc: "netdev@vger.kernel.org" , wg@grandegger.com, mkl@pengutronix.de, linux-can@vger.kernel.org, Linux-sh list , vksavl@gmail.com List-Id: linux-can.vger.kernel.org Hello. On 20-01-2014 15:43, Geert Uytterhoeven wrote: >> Changes in version 3: >> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs'; >> - removed unneeded type cast in the probe() method. >> +/* Mailbox registers structure */ >> +struct rcar_can_mbox_regs { >> + u32 id; /* IDE and RTR bits, SID and EID */ >> + u8 stub; /* Not used */ >> + u8 dlc; /* Data Length Code - bits [0..3] */ >> + u8 data[8]; /* Data Bytes */ >> + u8 tsh; /* Time Stamp Higher Byte */ >> + u8 tsl; /* Time Stamp Lower Byte */ >> +} __packed; > Sorry, I missed the earlier discussion, but why the _packed? > One u32 and 12 bytes makes a nice multiple of 4. Mainly for consistency as this is a structure representing the hardware registers. > Gr{oetje,eeting}s, > Geert WBR, Sergei