diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-05 10:10:27 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-05 12:02:33 -0400 |
commit | c0fc18c5bf016a9d56aee64974c1ccdb87f3c783 (patch) | |
tree | a5269222c380d39846d477c68264247e601a31fc | |
parent | 7c7095aa423b9b14038abc08fba84b9d7a33d643 (diff) |
[ARM] omap: fix lots of 'Using plain integer as NULL pointer'
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-omap1/clock.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/dma.c | 2 | ||||
-rw-r--r-- | drivers/video/omap/omapfb_main.c | 6 |
5 files changed, 18 insertions, 18 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 51a9be6763fc..90ae0ef37d66 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -201,7 +201,7 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate) | |||
201 | return -EINVAL; | 201 | return -EINVAL; |
202 | 202 | ||
203 | parent = clk->parent; | 203 | parent = clk->parent; |
204 | if (unlikely(parent == 0)) | 204 | if (unlikely(parent == NULL)) |
205 | return -EIO; | 205 | return -EIO; |
206 | 206 | ||
207 | realrate = parent->rate; | 207 | realrate = parent->rate; |
@@ -499,7 +499,7 @@ static int omap1_clk_enable_generic(struct clk *clk) | |||
499 | if (clk->flags & ALWAYS_ENABLED) | 499 | if (clk->flags & ALWAYS_ENABLED) |
500 | return 0; | 500 | return 0; |
501 | 501 | ||
502 | if (unlikely(clk->enable_reg == 0)) { | 502 | if (unlikely(clk->enable_reg == NULL)) { |
503 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", | 503 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
504 | clk->name); | 504 | clk->name); |
505 | return -EINVAL; | 505 | return -EINVAL; |
@@ -535,7 +535,7 @@ static void omap1_clk_disable_generic(struct clk *clk) | |||
535 | __u16 regval16; | 535 | __u16 regval16; |
536 | __u32 regval32; | 536 | __u32 regval32; |
537 | 537 | ||
538 | if (clk->enable_reg == 0) | 538 | if (clk->enable_reg == NULL) |
539 | return; | 539 | return; |
540 | 540 | ||
541 | if (clk->flags & ENABLE_REG_32BIT) { | 541 | if (clk->flags & ENABLE_REG_32BIT) { |
@@ -577,7 +577,7 @@ static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) | |||
577 | return clk->parent->rate / (1 << dsor_exp); | 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 | return clk->round_rate(clk, rate); | 581 | return clk->round_rate(clk, rate); |
582 | 582 | ||
583 | return clk->rate; | 583 | return clk->rate; |
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 1d891e4a6933..84cd1d9fcef9 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -251,7 +251,7 @@ int _omap2_clk_enable(struct clk *clk) | |||
251 | if (clk->enable) | 251 | if (clk->enable) |
252 | return clk->enable(clk); | 252 | return clk->enable(clk); |
253 | 253 | ||
254 | if (unlikely(clk->enable_reg == 0)) { | 254 | if (unlikely(clk->enable_reg == NULL)) { |
255 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", | 255 | printk(KERN_ERR "clock.c: Enable for %s without enable code\n", |
256 | clk->name); | 256 | clk->name); |
257 | return 0; /* REVISIT: -EINVAL */ | 257 | return 0; /* REVISIT: -EINVAL */ |
@@ -283,7 +283,7 @@ void _omap2_clk_disable(struct clk *clk) | |||
283 | return; | 283 | return; |
284 | } | 284 | } |
285 | 285 | ||
286 | if (clk->enable_reg == 0) { | 286 | if (clk->enable_reg == NULL) { |
287 | /* | 287 | /* |
288 | * 'Independent' here refers to a clock which is not | 288 | * 'Independent' here refers to a clock which is not |
289 | * controlled by its parent. | 289 | * controlled by its parent. |
@@ -477,7 +477,7 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate) | |||
477 | /* Given a clock and a rate apply a clock specific rounding function */ | 477 | /* Given a clock and a rate apply a clock specific rounding function */ |
478 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate) | 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 | return clk->round_rate(clk, rate); | 481 | return clk->round_rate(clk, rate); |
482 | 482 | ||
483 | if (clk->flags & RATE_FIXED) | 483 | if (clk->flags & RATE_FIXED) |
@@ -566,7 +566,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | |||
566 | */ | 566 | */ |
567 | void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask) | 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 | return NULL; | 570 | return NULL; |
571 | 571 | ||
572 | *field_mask = clk->clksel_mask; | 572 | *field_mask = clk->clksel_mask; |
@@ -586,7 +586,7 @@ u32 omap2_clksel_get_divisor(struct clk *clk) | |||
586 | void __iomem *div_addr; | 586 | void __iomem *div_addr; |
587 | 587 | ||
588 | div_addr = omap2_get_clksel(clk, &field_mask); | 588 | div_addr = omap2_get_clksel(clk, &field_mask); |
589 | if (div_addr == 0) | 589 | if (div_addr == NULL) |
590 | return 0; | 590 | return 0; |
591 | 591 | ||
592 | field_val = __raw_readl(div_addr) & field_mask; | 592 | field_val = __raw_readl(div_addr) & field_mask; |
@@ -605,7 +605,7 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) | |||
605 | return -EINVAL; | 605 | return -EINVAL; |
606 | 606 | ||
607 | div_addr = omap2_get_clksel(clk, &field_mask); | 607 | div_addr = omap2_get_clksel(clk, &field_mask); |
608 | if (div_addr == 0) | 608 | if (div_addr == NULL) |
609 | return -EINVAL; | 609 | return -EINVAL; |
610 | 610 | ||
611 | field_val = omap2_divisor_to_clksel(clk, new_div); | 611 | field_val = omap2_divisor_to_clksel(clk, new_div); |
@@ -643,7 +643,7 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
643 | return -EINVAL; | 643 | return -EINVAL; |
644 | 644 | ||
645 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ | 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 | ret = clk->set_rate(clk, rate); | 647 | ret = clk->set_rate(clk, rate); |
648 | 648 | ||
649 | if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) | 649 | if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) |
@@ -664,7 +664,7 @@ static u32 omap2_clksel_get_src_field(void __iomem **src_addr, | |||
664 | const struct clksel_rate *clkr; | 664 | const struct clksel_rate *clkr; |
665 | 665 | ||
666 | *parent_div = 0; | 666 | *parent_div = 0; |
667 | *src_addr = 0; | 667 | *src_addr = NULL; |
668 | 668 | ||
669 | clks = omap2_get_clksel_by_parent(clk, src_clk); | 669 | clks = omap2_get_clksel_by_parent(clk, src_clk); |
670 | if (clks == NULL) | 670 | if (clks == NULL) |
@@ -705,7 +705,7 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
705 | 705 | ||
706 | field_val = omap2_clksel_get_src_field(&src_addr, new_parent, | 706 | field_val = omap2_clksel_get_src_field(&src_addr, new_parent, |
707 | &field_mask, clk, &parent_div); | 707 | &field_mask, clk, &parent_div); |
708 | if (src_addr == 0) | 708 | if (src_addr == NULL) |
709 | return -EINVAL; | 709 | return -EINVAL; |
710 | 710 | ||
711 | if (clk->usecount > 0) | 711 | if (clk->usecount > 0) |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 7faa53c3a925..69651cf08305 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -108,7 +108,7 @@ void __init omap_serial_init() | |||
108 | struct plat_serial8250_port *p = serial_platform_data + i; | 108 | struct plat_serial8250_port *p = serial_platform_data + i; |
109 | 109 | ||
110 | if (!(info->enabled_uarts & (1 << i))) { | 110 | if (!(info->enabled_uarts & (1 << i))) { |
111 | p->membase = 0; | 111 | p->membase = NULL; |
112 | p->mapbase = 0; | 112 | p->mapbase = 0; |
113 | continue; | 113 | continue; |
114 | } | 114 | } |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index b4057e271875..50f8b4ad9a09 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -1233,7 +1233,7 @@ int omap_request_dma_chain(int dev_id, const char *dev_name, | |||
1233 | /* request and reserve DMA channels for the chain */ | 1233 | /* request and reserve DMA channels for the chain */ |
1234 | for (i = 0; i < no_of_chans; i++) { | 1234 | for (i = 0; i < no_of_chans; i++) { |
1235 | err = omap_request_dma(dev_id, dev_name, | 1235 | err = omap_request_dma(dev_id, dev_name, |
1236 | callback, 0, &channels[i]); | 1236 | callback, NULL, &channels[i]); |
1237 | if (err < 0) { | 1237 | if (err < 0) { |
1238 | int j; | 1238 | int j; |
1239 | for (j = 0; j < i; j++) | 1239 | for (j = 0; j < i; j++) |
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 51a138bd113c..06a69e0345de 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c | |||
@@ -740,7 +740,7 @@ static int omapfb_update_win(struct fb_info *fbi, | |||
740 | int ret; | 740 | int ret; |
741 | 741 | ||
742 | omapfb_rqueue_lock(plane->fbdev); | 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 | omapfb_rqueue_unlock(plane->fbdev); | 744 | omapfb_rqueue_unlock(plane->fbdev); |
745 | 745 | ||
746 | return ret; | 746 | return ret; |
@@ -768,7 +768,7 @@ static int omapfb_update_full_screen(struct fb_info *fbi) | |||
768 | win.format = 0; | 768 | win.format = 0; |
769 | 769 | ||
770 | omapfb_rqueue_lock(fbdev); | 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 | omapfb_rqueue_unlock(fbdev); | 772 | omapfb_rqueue_unlock(fbdev); |
773 | 773 | ||
774 | return r; | 774 | return r; |
@@ -1047,7 +1047,7 @@ void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval) | |||
1047 | win.height = 2; | 1047 | win.height = 2; |
1048 | win.out_width = 2; | 1048 | win.out_width = 2; |
1049 | win.out_height = 2; | 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 | omapfb_rqueue_unlock(fbdev); | 1052 | omapfb_rqueue_unlock(fbdev); |
1053 | } | 1053 | } |