From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Thu, 10 Oct 2019 11:29:13 +0200 Subject: [U-Boot] [PATCH v3 3/4] arm: socfpga: Convert system manager from struct to defines In-Reply-To: References: <1570688406-35914-1-git-send-email-ley.foon.tan@intel.com> <1570688406-35914-4-git-send-email-ley.foon.tan@intel.com> <20191010100944.6c1e3aba@crub> Message-ID: <20191010112913.4a580c80@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 10 Oct 2019 10:43:46 +0200 Simon Goldschmidt simon.k.r.goldschmidt at gmail.com wrote: ... > > Why is this required? In the past we have rejected all new code adding > > defines instead of structs for register accesses. Have we changed our mind now? > > Who is we? U-Boot maintainers/community. > I haven't noticed that in the last 2 years. Plus Linux is rather > using structs than defines, or am I wrong? The preferred way for I/O access is documented in [1], see "Use structures for I/O access" section. > This started because Ley introduced a new platform where the structs were > nearly the same but *some* registers have changed. Adding new structs > that were nearly the same seemed more mess than using the same defines. > > I'm not pressing this into any direction, we can continue using structs > if that's the consensus. If there is no other easy way to continue using struct, then this should be mentioned in the commit description/cover letter to justify the changes. [1] http://www.denx.de/wiki/U-Boot/CodingStyle -- Anatolij