Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mpc512x: fix noderef sparse warnings

Fix:
warning: dereference of noderef expression

Signed-off-by: Anatolij Gustschin <agust@denx.de>

+9 -9
+9 -9
arch/powerpc/platforms/512x/clock.c
··· 184 184 36, 40, 44, 48, 185 185 52, 56, 60, 64 186 186 }; 187 - int spmf = (clockctl->spmr >> 24) & 0xf; 187 + int spmf = (in_be32(&clockctl->spmr) >> 24) & 0xf; 188 188 return spmf_to_mult[spmf]; 189 189 } 190 190 ··· 206 206 52, 56, 58, 62, 207 207 60, 64, 66, 208 208 }; 209 - int sysdiv = (clockctl->scfr2 >> 26) & 0x3f; 209 + int sysdiv = (in_be32(&clockctl->scfr2) >> 26) & 0x3f; 210 210 return sysdiv_to_div_x_2[sysdiv]; 211 211 } 212 212 ··· 230 230 231 231 static long ips_to_ref(unsigned long rate) 232 232 { 233 - int ips_div = (clockctl->scfr1 >> 23) & 0x7; 233 + int ips_div = (in_be32(&clockctl->scfr1) >> 23) & 0x7; 234 234 235 235 rate *= ips_div; /* csb_clk = ips_clk * ips_div */ 236 236 rate *= 2; /* sys_clk = csb_clk * 2 */ ··· 284 284 285 285 static void diu_clk_calc(struct clk *clk) 286 286 { 287 - int diudiv_x_2 = clockctl->scfr1 & 0xff; 287 + int diudiv_x_2 = in_be32(&clockctl->scfr1) & 0xff; 288 288 unsigned long rate; 289 289 290 290 rate = sys_clk.rate; ··· 311 311 312 312 static void generic_div_clk_calc(struct clk *clk) 313 313 { 314 - int div = (clockctl->scfr1 >> clk->div_shift) & 0x7; 314 + int div = (in_be32(&clockctl->scfr1) >> clk->div_shift) & 0x7; 315 315 316 316 clk->rate = clk->parent->rate / div; 317 317 } ··· 329 329 330 330 static void e300_clk_calc(struct clk *clk) 331 331 { 332 - int spmf = (clockctl->spmr >> 16) & 0xf; 332 + int spmf = (in_be32(&clockctl->spmr) >> 16) & 0xf; 333 333 int ratex2 = clk->parent->rate * spmf; 334 334 335 335 clk->rate = ratex2 / 2; ··· 648 648 out_be32(&clockctl->pccr[pscnum], 0x00020000); 649 649 out_be32(&clockctl->pccr[pscnum], 0x00030000); 650 650 651 - if (clockctl->pccr[pscnum] & 0x80) { 651 + if (in_be32(&clockctl->pccr[pscnum]) & 0x80) { 652 652 clk->rate = spdif_rxclk.rate; 653 653 return; 654 654 } 655 655 656 - switch ((clockctl->pccr[pscnum] >> 14) & 0x3) { 656 + switch ((in_be32(&clockctl->pccr[pscnum]) >> 14) & 0x3) { 657 657 case 0: 658 658 mclk_src = sys_clk.rate; 659 659 break; ··· 668 668 break; 669 669 } 670 670 671 - mclk_div = ((clockctl->pccr[pscnum] >> 17) & 0x7fff) + 1; 671 + mclk_div = ((in_be32(&clockctl->pccr[pscnum]) >> 17) & 0x7fff) + 1; 672 672 clk->rate = mclk_src / mclk_div; 673 673 } 674 674