Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc9e8b4e authored by Timur Tabi's avatar Timur Tabi Committed by Paul Mackerras
Browse files

[PATCH] Optimize qe_brg struct to use an array



The qe_brg structure manually defined each of the 16 BRG registers, which
made any code that used them cumbersome.  This patch replaces the fields
with a single 16-element array.

Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 0613ffbf
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -175,8 +175,7 @@ void qe_setbrg(u32 brg, u32 rate)
	u32 divisor, tempval;
	u32 divisor, tempval;
	int div16 = 0;
	int div16 = 0;


	bp = &qe_immr->brg.brgc1;
	bp = &qe_immr->brg.brgc[brg];
	bp += brg;


	divisor = (get_brg_clk() / rate);
	divisor = (get_brg_clk() / rate);
	if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
	if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
+1 −16
Original line number Original line Diff line number Diff line
@@ -136,22 +136,7 @@ struct qe_timers {


/* BRG */
/* BRG */
struct qe_brg {
struct qe_brg {
	__be32	brgc1;		/* BRG1 configuration register */
	__be32	brgc[16];	/* BRG configuration registers */
	__be32	brgc2;		/* BRG2 configuration register */
	__be32	brgc3;		/* BRG3 configuration register */
	__be32	brgc4;		/* BRG4 configuration register */
	__be32	brgc5;		/* BRG5 configuration register */
	__be32	brgc6;		/* BRG6 configuration register */
	__be32	brgc7;		/* BRG7 configuration register */
	__be32	brgc8;		/* BRG8 configuration register */
	__be32	brgc9;		/* BRG9 configuration register */
	__be32	brgc10;		/* BRG10 configuration register */
	__be32	brgc11;		/* BRG11 configuration register */
	__be32	brgc12;		/* BRG12 configuration register */
	__be32	brgc13;		/* BRG13 configuration register */
	__be32	brgc14;		/* BRG14 configuration register */
	__be32	brgc15;		/* BRG15 configuration register */
	__be32	brgc16;		/* BRG16 configuration register */
	u8	res0[0x40];
	u8	res0[0x40];
} __attribute__ ((packed));
} __attribute__ ((packed));