* [PATCH next-20140424] staging/cxt1e1: hwprobe.c sparse warning corrections
@ 2014-04-26 15:30 Sami Laine
2014-04-26 15:42 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Sami Laine @ 2014-04-26 15:30 UTC (permalink / raw)
To: daeseok.youn; +Cc: gregkh, devel, linux-kernel, trivial
From: Sami Laine <laine.j.sami@gmail.com>
Sparse warning corrections:
- declarations made static where they should be such
- changed NULL-pointers as NULL instead of static 0's
- added __force to a few casts seemingly safe enough
Signed-off-by: Sami Laine <laine.j.sami@gmail.com>
---
diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index cc2151e..d1c0493 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -40,10 +40,10 @@ struct net_device * __init c4_add_dev(hdw_info_t *, int, unsigned long,
unsigned long, int, int);
-struct s_hdw_info hdw_info[MAX_BOARDS];
+static struct s_hdw_info hdw_info[MAX_BOARDS];
-void __init
+static void __init
show_two(hdw_info_t *hi, int brdno)
{
ci_t *ci;
@@ -88,13 +88,13 @@ show_two(hdw_info_t *hi, int brdno)
}
-void __init
+static void __init
hdw_sn_get(hdw_info_t *hi, int brdno)
{
/* obtain hardware EEPROM information */
- long addr;
+ long addr;
- addr = (long) hi->addr_mapped[1] + EEPROM_OFFSET;
+ addr = (long __force)hi->addr_mapped[1] + EEPROM_OFFSET;
/* read EEPROM with largest known format size... */
pmc_eeprom_read_buffer(addr, 0, (char *)hi->mfg_info.data,
@@ -145,7 +145,7 @@ hdw_sn_get(hdw_info_t *hi, int brdno)
}
- void __init
+static void __init
prep_hdw_info(void)
{
hdw_info_t *hi;
@@ -159,12 +159,12 @@ prep_hdw_info(void)
hi->ndev = NULL;
hi->addr[0] = 0L;
hi->addr[1] = 0L;
- hi->addr_mapped[0] = 0L;
- hi->addr_mapped[1] = 0L;
+ hi->addr_mapped[0] = NULL;
+ hi->addr_mapped[1] = NULL;
}
}
-void
+static void
cleanup_ioremap(void)
{
hdw_info_t *hi;
@@ -176,18 +176,18 @@ cleanup_ioremap(void)
if (hi->addr_mapped[0]) {
iounmap(hi->addr_mapped[0]);
release_mem_region((long) hi->addr[0], hi->len[0]);
- hi->addr_mapped[0] = 0;
+ hi->addr_mapped[0] = NULL;
}
if (hi->addr_mapped[1]) {
iounmap(hi->addr_mapped[1]);
release_mem_region((long) hi->addr[1], hi->len[1]);
- hi->addr_mapped[1] = 0;
+ hi->addr_mapped[1] = NULL;
}
}
}
-void
+static void
cleanup_devs(void)
{
hdw_info_t *hi;
@@ -287,7 +287,7 @@ c4_hdw_init(struct pci_dev *pdev, int found)
return 1;
}
-status_t __init
+static status_t __init
c4hw_attach_all(void)
{
hdw_info_t *hi;
@@ -361,10 +361,11 @@ c4hw_attach_all(void)
}
pci_set_master(hi->pdev[0]);
pci_set_master(hi->pdev[1]);
- hi->ndev = c4_add_dev(hi, i, (long) hi->addr_mapped[0],
- (long) hi->addr_mapped[1],
- hi->pdev[0]->irq,
- hi->pdev[1]->irq);
+ hi->ndev = c4_add_dev(hi, i,
+ (unsigned long __force) hi->addr_mapped[0],
+ (unsigned long __force) hi->addr_mapped[1],
+ hi->pdev[0]->irq,
+ hi->pdev[1]->irq);
if (!hi->ndev) {
drvr_state = SBE_DRVR_DOWN;
cleanup_ioremap();
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next-20140424] staging/cxt1e1: hwprobe.c sparse warning corrections
2014-04-26 15:30 [PATCH next-20140424] staging/cxt1e1: hwprobe.c sparse warning corrections Sami Laine
@ 2014-04-26 15:42 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2014-04-26 15:42 UTC (permalink / raw)
To: Sami Laine; +Cc: daeseok.youn, devel, trivial, linux-kernel
On Sat, Apr 26, 2014 at 06:30:33PM +0300, Sami Laine wrote:
> From: Sami Laine <laine.j.sami@gmail.com>
>
> Sparse warning corrections:
> - declarations made static where they should be such
> - changed NULL-pointers as NULL instead of static 0's
> - added __force to a few casts seemingly safe enough
You did 3 different things here, can you split this up into 3 different
patches? Especially as someone already sent in the NULL pointer
patch...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-26 15:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-26 15:30 [PATCH next-20140424] staging/cxt1e1: hwprobe.c sparse warning corrections Sami Laine
2014-04-26 15:42 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.