From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756666AbcLOXMG (ORCPT ); Thu, 15 Dec 2016 18:12:06 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:63040 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067AbcLOXMD (ORCPT ); Thu, 15 Dec 2016 18:12:03 -0500 From: Arnd Bergmann To: Holger Dengler Cc: Lee Jones , Greg Kroah-Hartman , Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Thomas Gleixner , Sebastian Siewior , Juergen Bubeck , Peter Mahler , Benedikt Spranger Subject: Re: [PATCH 01/12] mfd: Eberspaecher Flexcard PMC II Carrier Board support Date: Wed, 14 Dec 2016 09:38:54 +0100 Message-ID: <15584607.P8pE8oSqpO@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1481674313-30378-2-git-send-email-dengler@linutronix.de> References: <1481674313-30378-1-git-send-email-dengler@linutronix.de> <1481674313-30378-2-git-send-email-dengler@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:9KjBcmYE5mOEe7oNsvhGf6hDc5XFA2l31vD1IZJ/V9uWlee798B +DOaodn8olyILEDaVObcoUmdTzaiKy8gi7r2zELgEkByJB2BsWSj0/NILmu4gyMBTJ0bSkj xft89Ds7C3GpPMTZ+INSBRp71FTBSiAm0vHgWWn9ifUgxg8CqLf5H9crGRxkMT544Jf9fNW nfa3R/malcYcn+DzNe9Jg== X-UI-Out-Filterresults: notjunk:1;V01:K0:qrzpocJfm3Y=:z11XuL/LSBdWTW8Kh7y6Qy mYlo0V/5ZQK1CjykMNZToOyQYjjy6xxu2FOu/snUXzzjFxuLGkeo6fYgzTdBbu6wnHj8o0cky kWmULm2pQvfRhSPiOEnMCJS6gH9MRnnbA3oEyrEqwcNfegu4e/llJh/3sxdNi5hDAPmRmnvha grTMsdWEaSymAKc6hFJYDbh075c3mcihACtNefBv0Mk3/Z9o0EwS7FcF2lRa8vNyTLYxrxOWM 3GqDO7T6V5sYXmWo2E05HpCvWfq64R3Bep38cDGlmDXHY3jReTcw1clmID16714NHKZriC1Dz 4896bgeVkGjiSKFV3nzC4kuSI0mrY9CIMHfI3QkGN62r/Z/i66om+OjuhfnHrB9HuNxAr+mZh OOuWGRtdJCt2ehOQS7qQHlrvaaJSKhFXtXu1hwne1X+100d6MGs75O/f6gk5tOEDtXSHvJKgw o7asLlqq4JlhVmzNe2o14T5heF/E6ETJ+skfuStiowyCif7O/CBfqkU7wWX/YfOEkX/2eaxHw 9auqDUmF+m6CfpV6Aq5BV8RKRxLwtxHXMaq6TF0yfXylu1SQni0iaz0pLktwdXKHGjI62svpW 5izNprb2R/cUEcSUWIeBL8UcpoSAhHVkAcgSAmZ8z3niRVCgNFby/jwFpGgbbVb3XkV9CYJud fObChdu/5KEhrU7lU9gtMGOAcvhio9+2OUPh31gSLWfEDwHCAc7bJNRn+bYIm8ueAuvuZRfQA eX9vAp5+/zbNVHz+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, December 14, 2016 1:11:42 AM CET Holger Dengler wrote: > > diff --git a/include/uapi/linux/flexcard.h b/include/uapi/linux/flexcard.h > new file mode 100644 > index 0000000..4e9f07b4 > --- /dev/null > +++ b/include/uapi/linux/flexcard.h > @@ -0,0 +1,64 @@ Why is this exported to user space? > + > +#include > + > +struct fc_version { > + __u8 dev; > + __u8 min; > + __u8 maj; > + __u8 reserved; > +} __packed; The __packed attribute is redundant here as all members are just one byte anyway. > +/* PCI BAR 0: Flexcard configuration */ > +struct fc_bar0_conf { > + __u32 r1; /* 000 */ > + struct fc_version fc_fw_ver; /* 004 */ > + struct fc_version fc_hw_ver; /* 008 */ > + __u32 r2[3]; /* 00c */ > + __u64 fc_sn; /* 018 */ > + __u32 fc_uid; /* 020 */ > + __u32 r3[7]; /* 024 */ > + __u32 fc_lic[6]; /* 040 */ > + __u32 fc_slic[6]; /* 058 */ > + __u32 trig_ctrl1; /* 070 */ > + __u32 r4; /* 074 */ > + __u32 trig_ctrl2; /* 078 */ > + __u32 r5[22]; /* 07c */ > + __u32 amreg; /* 0d4 */ > + __u32 tiny_stat; /* 0d8 */ > + __u32 r6[5]; /* 0dc */ > + __u32 can_dat_cnt; /* 0f0 */ > + __u32 can_err_cnt; /* 0f4 */ > + __u32 fc_data_cnt; /* 0f8 */ > + __u32 r7; /* 0fc */ > + __u32 fc_rocr; /* 100 */ > + __u32 r8; /* 104 */ > + __u32 pg_ctrl; /* 108 */ > + __u32 pg_term; /* 10c */ > + __u32 r9; /* 110 */ > + __u32 irs; /* 114 */ > + __u32 fr_tx_cnt; /* 118 */ > + __u32 irc; /* 11c */ > + __u64 pcnt; /* 120 */ > + __u32 r10; /* 128 */ > + __u32 nmv_cnt; /* 12c */ > + __u32 info_cnt; /* 130 */ > + __u32 stat_trg_cnt; /* 134 */ > + __u32 r11; /* 138 */ > + __u32 fr_rx_cnt; /* 13c */ > +} __packed; Here the __packed attribute is probably harmful, it prevents you from accessing the members using 32-bit sized accesses and forces bytewise accesses on some architectures, which tends to do the wrong thing on MMIO. Arnd