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

[ARM] omap: fix lots of 'Using plain integer as NULL pointer'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
c0fc18c5 7c7095aa

+18 -18
+4 -4
arch/arm/mach-omap1/clock.c
··· 201 201 return -EINVAL; 202 202 203 203 parent = clk->parent; 204 - if (unlikely(parent == 0)) 204 + if (unlikely(parent == NULL)) 205 205 return -EIO; 206 206 207 207 realrate = parent->rate; ··· 499 499 if (clk->flags & ALWAYS_ENABLED) 500 500 return 0; 501 501 502 - if (unlikely(clk->enable_reg == 0)) { 502 + if (unlikely(clk->enable_reg == NULL)) { 503 503 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 504 504 clk->name); 505 505 return -EINVAL; ··· 535 535 __u16 regval16; 536 536 __u32 regval32; 537 537 538 - if (clk->enable_reg == 0) 538 + if (clk->enable_reg == NULL) 539 539 return; 540 540 541 541 if (clk->flags & ENABLE_REG_32BIT) { ··· 577 577 return clk->parent->rate / (1 << dsor_exp); 578 578 } 579 579 580 - if(clk->round_rate != 0) 580 + if (clk->round_rate != NULL) 581 581 return clk->round_rate(clk, rate); 582 582 583 583 return clk->rate;
+9 -9
arch/arm/mach-omap2/clock.c
··· 251 251 if (clk->enable) 252 252 return clk->enable(clk); 253 253 254 - if (unlikely(clk->enable_reg == 0)) { 254 + if (unlikely(clk->enable_reg == NULL)) { 255 255 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 256 256 clk->name); 257 257 return 0; /* REVISIT: -EINVAL */ ··· 283 283 return; 284 284 } 285 285 286 - if (clk->enable_reg == 0) { 286 + if (clk->enable_reg == NULL) { 287 287 /* 288 288 * 'Independent' here refers to a clock which is not 289 289 * controlled by its parent. ··· 477 477 /* Given a clock and a rate apply a clock specific rounding function */ 478 478 long omap2_clk_round_rate(struct clk *clk, unsigned long rate) 479 479 { 480 - if (clk->round_rate != 0) 480 + if (clk->round_rate != NULL) 481 481 return clk->round_rate(clk, rate); 482 482 483 483 if (clk->flags & RATE_FIXED) ··· 566 566 */ 567 567 void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask) 568 568 { 569 - if (unlikely((clk->clksel_reg == 0) || (clk->clksel_mask == 0))) 569 + if (unlikely((clk->clksel_reg == NULL) || (clk->clksel_mask == NULL))) 570 570 return NULL; 571 571 572 572 *field_mask = clk->clksel_mask; ··· 586 586 void __iomem *div_addr; 587 587 588 588 div_addr = omap2_get_clksel(clk, &field_mask); 589 - if (div_addr == 0) 589 + if (div_addr == NULL) 590 590 return 0; 591 591 592 592 field_val = __raw_readl(div_addr) & field_mask; ··· 605 605 return -EINVAL; 606 606 607 607 div_addr = omap2_get_clksel(clk, &field_mask); 608 - if (div_addr == 0) 608 + if (div_addr == NULL) 609 609 return -EINVAL; 610 610 611 611 field_val = omap2_divisor_to_clksel(clk, new_div); ··· 643 643 return -EINVAL; 644 644 645 645 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ 646 - if (clk->set_rate != 0) 646 + if (clk->set_rate != NULL) 647 647 ret = clk->set_rate(clk, rate); 648 648 649 649 if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) ··· 664 664 const struct clksel_rate *clkr; 665 665 666 666 *parent_div = 0; 667 - *src_addr = 0; 667 + *src_addr = NULL; 668 668 669 669 clks = omap2_get_clksel_by_parent(clk, src_clk); 670 670 if (clks == NULL) ··· 705 705 706 706 field_val = omap2_clksel_get_src_field(&src_addr, new_parent, 707 707 &field_mask, clk, &parent_div); 708 - if (src_addr == 0) 708 + if (src_addr == NULL) 709 709 return -EINVAL; 710 710 711 711 if (clk->usecount > 0)
+1 -1
arch/arm/mach-omap2/serial.c
··· 108 108 struct plat_serial8250_port *p = serial_platform_data + i; 109 109 110 110 if (!(info->enabled_uarts & (1 << i))) { 111 - p->membase = 0; 111 + p->membase = NULL; 112 112 p->mapbase = 0; 113 113 continue; 114 114 }
+1 -1
arch/arm/plat-omap/dma.c
··· 1233 1233 /* request and reserve DMA channels for the chain */ 1234 1234 for (i = 0; i < no_of_chans; i++) { 1235 1235 err = omap_request_dma(dev_id, dev_name, 1236 - callback, 0, &channels[i]); 1236 + callback, NULL, &channels[i]); 1237 1237 if (err < 0) { 1238 1238 int j; 1239 1239 for (j = 0; j < i; j++)
+3 -3
drivers/video/omap/omapfb_main.c
··· 740 740 int ret; 741 741 742 742 omapfb_rqueue_lock(plane->fbdev); 743 - ret = omapfb_update_window_async(fbi, win, NULL, 0); 743 + ret = omapfb_update_window_async(fbi, win, NULL, NULL); 744 744 omapfb_rqueue_unlock(plane->fbdev); 745 745 746 746 return ret; ··· 768 768 win.format = 0; 769 769 770 770 omapfb_rqueue_lock(fbdev); 771 - r = fbdev->ctrl->update_window(fbi, &win, NULL, 0); 771 + r = fbdev->ctrl->update_window(fbi, &win, NULL, NULL); 772 772 omapfb_rqueue_unlock(fbdev); 773 773 774 774 return r; ··· 1047 1047 win.height = 2; 1048 1048 win.out_width = 2; 1049 1049 win.out_height = 2; 1050 - fbdev->ctrl->update_window(fbdev->fb_info[0], &win, NULL, 0); 1050 + fbdev->ctrl->update_window(fbdev->fb_info[0], &win, NULL, NULL); 1051 1051 } 1052 1052 omapfb_rqueue_unlock(fbdev); 1053 1053 }