diff options
author | Sahara <keun-o.park@windriver.com> | 2013-03-26 15:07:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-27 12:48:31 -0400 |
commit | 7d3ac5c7799152b817176849e4e95559a1ddf03f (patch) | |
tree | a6df1230fa42b75f04bacbd95e0f5f1e27e78c5a /drivers/ptp | |
parent | 6bdeaba47d87f48a3943b6899d6c6e6f17d52f1d (diff) |
ptp_pch: eliminate a number of sparse warnings
This fixes a number of sparse warnings like:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got unsigned int *<noident>
warning: Using plain integer as NULL pointer
Additionally this fixes a warning from checkpatch.pl like:
WARNING: sizeof pch_param.station should be sizeof(pch_param.station)
Signed-off-by: Sahara <keun-o.park@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp')
-rw-r--r-- | drivers/ptp/ptp_pch.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c index e85926bf2de7..bea94510ad2d 100644 --- a/drivers/ptp/ptp_pch.c +++ b/drivers/ptp/ptp_pch.c | |||
@@ -118,7 +118,7 @@ struct pch_ts_regs { | |||
118 | * struct pch_dev - Driver private data | 118 | * struct pch_dev - Driver private data |
119 | */ | 119 | */ |
120 | struct pch_dev { | 120 | struct pch_dev { |
121 | struct pch_ts_regs *regs; | 121 | struct pch_ts_regs __iomem *regs; |
122 | struct ptp_clock *ptp_clock; | 122 | struct ptp_clock *ptp_clock; |
123 | struct ptp_clock_info caps; | 123 | struct ptp_clock_info caps; |
124 | int exts0_enabled; | 124 | int exts0_enabled; |
@@ -154,7 +154,7 @@ static inline void pch_eth_enable_set(struct pch_dev *chip) | |||
154 | iowrite32(val, (&chip->regs->ts_sel)); | 154 | iowrite32(val, (&chip->regs->ts_sel)); |
155 | } | 155 | } |
156 | 156 | ||
157 | static u64 pch_systime_read(struct pch_ts_regs *regs) | 157 | static u64 pch_systime_read(struct pch_ts_regs __iomem *regs) |
158 | { | 158 | { |
159 | u64 ns; | 159 | u64 ns; |
160 | u32 lo, hi; | 160 | u32 lo, hi; |
@@ -169,7 +169,7 @@ static u64 pch_systime_read(struct pch_ts_regs *regs) | |||
169 | return ns; | 169 | return ns; |
170 | } | 170 | } |
171 | 171 | ||
172 | static void pch_systime_write(struct pch_ts_regs *regs, u64 ns) | 172 | static void pch_systime_write(struct pch_ts_regs __iomem *regs, u64 ns) |
173 | { | 173 | { |
174 | u32 hi, lo; | 174 | u32 hi, lo; |
175 | 175 | ||
@@ -315,7 +315,7 @@ int pch_set_station_address(u8 *addr, struct pci_dev *pdev) | |||
315 | struct pch_dev *chip = pci_get_drvdata(pdev); | 315 | struct pch_dev *chip = pci_get_drvdata(pdev); |
316 | 316 | ||
317 | /* Verify the parameter */ | 317 | /* Verify the parameter */ |
318 | if ((chip->regs == 0) || addr == (u8 *)NULL) { | 318 | if ((chip->regs == NULL) || addr == (u8 *)NULL) { |
319 | dev_err(&pdev->dev, | 319 | dev_err(&pdev->dev, |
320 | "invalid params returning PCH_INVALIDPARAM\n"); | 320 | "invalid params returning PCH_INVALIDPARAM\n"); |
321 | return PCH_INVALIDPARAM; | 321 | return PCH_INVALIDPARAM; |
@@ -361,7 +361,7 @@ EXPORT_SYMBOL(pch_set_station_address); | |||
361 | static irqreturn_t isr(int irq, void *priv) | 361 | static irqreturn_t isr(int irq, void *priv) |
362 | { | 362 | { |
363 | struct pch_dev *pch_dev = priv; | 363 | struct pch_dev *pch_dev = priv; |
364 | struct pch_ts_regs *regs = pch_dev->regs; | 364 | struct pch_ts_regs __iomem *regs = pch_dev->regs; |
365 | struct ptp_clock_event event; | 365 | struct ptp_clock_event event; |
366 | u32 ack = 0, lo, hi, val; | 366 | u32 ack = 0, lo, hi, val; |
367 | 367 | ||
@@ -415,7 +415,7 @@ static int ptp_pch_adjfreq(struct ptp_clock_info *ptp, s32 ppb) | |||
415 | u32 diff, addend; | 415 | u32 diff, addend; |
416 | int neg_adj = 0; | 416 | int neg_adj = 0; |
417 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); | 417 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); |
418 | struct pch_ts_regs *regs = pch_dev->regs; | 418 | struct pch_ts_regs __iomem *regs = pch_dev->regs; |
419 | 419 | ||
420 | if (ppb < 0) { | 420 | if (ppb < 0) { |
421 | neg_adj = 1; | 421 | neg_adj = 1; |
@@ -438,7 +438,7 @@ static int ptp_pch_adjtime(struct ptp_clock_info *ptp, s64 delta) | |||
438 | s64 now; | 438 | s64 now; |
439 | unsigned long flags; | 439 | unsigned long flags; |
440 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); | 440 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); |
441 | struct pch_ts_regs *regs = pch_dev->regs; | 441 | struct pch_ts_regs __iomem *regs = pch_dev->regs; |
442 | 442 | ||
443 | spin_lock_irqsave(&pch_dev->register_lock, flags); | 443 | spin_lock_irqsave(&pch_dev->register_lock, flags); |
444 | now = pch_systime_read(regs); | 444 | now = pch_systime_read(regs); |
@@ -455,7 +455,7 @@ static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec *ts) | |||
455 | u32 remainder; | 455 | u32 remainder; |
456 | unsigned long flags; | 456 | unsigned long flags; |
457 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); | 457 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); |
458 | struct pch_ts_regs *regs = pch_dev->regs; | 458 | struct pch_ts_regs __iomem *regs = pch_dev->regs; |
459 | 459 | ||
460 | spin_lock_irqsave(&pch_dev->register_lock, flags); | 460 | spin_lock_irqsave(&pch_dev->register_lock, flags); |
461 | ns = pch_systime_read(regs); | 461 | ns = pch_systime_read(regs); |
@@ -472,7 +472,7 @@ static int ptp_pch_settime(struct ptp_clock_info *ptp, | |||
472 | u64 ns; | 472 | u64 ns; |
473 | unsigned long flags; | 473 | unsigned long flags; |
474 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); | 474 | struct pch_dev *pch_dev = container_of(ptp, struct pch_dev, caps); |
475 | struct pch_ts_regs *regs = pch_dev->regs; | 475 | struct pch_ts_regs __iomem *regs = pch_dev->regs; |
476 | 476 | ||
477 | ns = ts->tv_sec * 1000000000ULL; | 477 | ns = ts->tv_sec * 1000000000ULL; |
478 | ns += ts->tv_nsec; | 478 | ns += ts->tv_nsec; |
@@ -567,9 +567,9 @@ static void pch_remove(struct pci_dev *pdev) | |||
567 | free_irq(pdev->irq, chip); | 567 | free_irq(pdev->irq, chip); |
568 | 568 | ||
569 | /* unmap the virtual IO memory space */ | 569 | /* unmap the virtual IO memory space */ |
570 | if (chip->regs != 0) { | 570 | if (chip->regs != NULL) { |
571 | iounmap(chip->regs); | 571 | iounmap(chip->regs); |
572 | chip->regs = 0; | 572 | chip->regs = NULL; |
573 | } | 573 | } |
574 | /* release the reserved IO memory space */ | 574 | /* release the reserved IO memory space */ |
575 | if (chip->mem_base != 0) { | 575 | if (chip->mem_base != 0) { |
@@ -670,7 +670,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
670 | err_req_irq: | 670 | err_req_irq: |
671 | ptp_clock_unregister(chip->ptp_clock); | 671 | ptp_clock_unregister(chip->ptp_clock); |
672 | iounmap(chip->regs); | 672 | iounmap(chip->regs); |
673 | chip->regs = 0; | 673 | chip->regs = NULL; |
674 | 674 | ||
675 | err_ioremap: | 675 | err_ioremap: |
676 | release_mem_region(chip->mem_base, chip->mem_size); | 676 | release_mem_region(chip->mem_base, chip->mem_size); |
@@ -723,7 +723,8 @@ static s32 __init ptp_pch_init(void) | |||
723 | module_init(ptp_pch_init); | 723 | module_init(ptp_pch_init); |
724 | module_exit(ptp_pch_exit); | 724 | module_exit(ptp_pch_exit); |
725 | 725 | ||
726 | module_param_string(station, pch_param.station, sizeof pch_param.station, 0444); | 726 | module_param_string(station, |
727 | pch_param.station, sizeof(pch_param.station), 0444); | ||
727 | MODULE_PARM_DESC(station, | 728 | MODULE_PARM_DESC(station, |
728 | "IEEE 1588 station address to use - colon separated hex values"); | 729 | "IEEE 1588 station address to use - colon separated hex values"); |
729 | 730 | ||