From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Wed, 10 Aug 2011 12:18:21 +0200 Subject: [U-Boot] [PATCH v4 1/2] ARMV7: Add support for Samsung ORIGEN board In-Reply-To: (Chander Kashyap's message of "Tue, 9 Aug 2011 16:02:59 +0530") References: <1311914519-10531-1-git-send-email-chander.kashyap@linaro.org> <1311914519-10531-2-git-send-email-chander.kashyap@linaro.org> <20110731100009.E4D6812B7AE4@gemini.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Chander, [...] >>> lease get rid of all these magic hard coded constants. Use symbolic >>> names instead. If needed, auto-generate these from the respective C >>> structs. If needed, create the C structs. >>> >> >> I will change hard coded values to symbolic names >> > > While doing this, I find that the values written to the registers are used > just once. So do you still prefer to have them as macros ? I did convert the > register offsets and addresses to macros, but did not find it right to have > macros for register values that are used just once. Please advise. Most of all we want to get rid of address constants in code. For _values_ that are written to some register, my personal preference is not so strong, alas if you _do_ use macros, usually already the macro name carries documentation as to what this is and it will make code reuse easier for the people having to maintain or build upon your code in the future. Cheers Detlev -- Zivilisation ist der Zaubertrick, der uns unsere wahre Natur verbirgt. -- Salman Rushdie -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de