From: Wolfgang Denk Date: Sat, 01 Nov 2014 14:44:50 +0100 Subject: [U-Boot] [PATCH 3/5] arm:imx-common introduce a new function to set gpr In-Reply-To: <1414808359-4750-4-git-send-email-Peng.Fan@freescale.com> References: <1414808359-4750-1-git-send-email-Peng.Fan@freescale.com> <1414808359-4750-4-git-send-email-Peng.Fan@freescale.com> Message-ID: <20141101134450.5082E383354@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peng Fan, In message <1414808359-4750-4-git-send-email-Peng.Fan@freescale.com> you wrote: > Add a new function mxc_iomux_set_gpr_register to > set the iomux gpr register. > > 32-bit general purpose registers according to SoC > requirements for any usage. ... > +/* > + * Configure the IOMUX General Purpose Registers. > + * > + * @group, which gpr register to configure. > + * @start_bit, the first bit to set > + * @num_bits, how many bits to set > + * @value, the value will be set to [start_bits...start_bits+num_bits-1] > + */ Can you please rework the API and use a mask instead of counting bits? Relying on bit numbers is error prone and inherently non-portable. Use the standard register access macros (like setbits, clrbits, clrsetbits) as example, please. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All I ask is a chance to prove that money can't make me happy.