diff options
| author | Joe Perches <joe@perches.com> | 2013-03-14 09:07:21 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-03-15 08:56:58 -0400 |
| commit | d0320f750093d012d3ed69fc1e8b385f654523d5 (patch) | |
| tree | 1f9c25c892c33275fb85a993e9a274dc5618370b /drivers/net/ethernet/natsemi | |
| parent | 68c45a2da34cb44962c6a48f8e474ec6b7853641 (diff) | |
drivers:net: Remove dma_alloc_coherent OOM messages
I believe these error messages are already logged
on allocation failure by warn_alloc_failed and so
get a dump_stack on OOM.
Remove the unnecessary additional error logging.
Around these deletions:
o Alignment neatening.
o Remove unnecessary casts of dma_alloc_coherent.
o Hoist assigns from ifs.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/natsemi')
| -rw-r--r-- | drivers/net/ethernet/natsemi/jazzsonic.c | 12 | ||||
| -rw-r--r-- | drivers/net/ethernet/natsemi/macsonic.c | 12 | ||||
| -rw-r--r-- | drivers/net/ethernet/natsemi/xtsonic.c | 12 |
3 files changed, 17 insertions, 19 deletions
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c index b0b361546365..c20766c2f65b 100644 --- a/drivers/net/ethernet/natsemi/jazzsonic.c +++ b/drivers/net/ethernet/natsemi/jazzsonic.c | |||
| @@ -175,13 +175,13 @@ static int sonic_probe1(struct net_device *dev) | |||
| 175 | 175 | ||
| 176 | /* Allocate the entire chunk of memory for the descriptors. | 176 | /* Allocate the entire chunk of memory for the descriptors. |
| 177 | Note that this cannot cross a 64K boundary. */ | 177 | Note that this cannot cross a 64K boundary. */ |
| 178 | if ((lp->descriptors = dma_alloc_coherent(lp->device, | 178 | lp->descriptors = dma_alloc_coherent(lp->device, |
| 179 | SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), | 179 | SIZEOF_SONIC_DESC * |
| 180 | &lp->descriptors_laddr, GFP_KERNEL)) == NULL) { | 180 | SONIC_BUS_SCALE(lp->dma_bitmode), |
| 181 | printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n", | 181 | &lp->descriptors_laddr, |
| 182 | dev_name(lp->device)); | 182 | GFP_KERNEL); |
| 183 | if (lp->descriptors == NULL) | ||
| 183 | goto out; | 184 | goto out; |
| 184 | } | ||
| 185 | 185 | ||
| 186 | /* Now set up the pointers to point to the appropriate places */ | 186 | /* Now set up the pointers to point to the appropriate places */ |
| 187 | lp->cda = lp->descriptors; | 187 | lp->cda = lp->descriptors; |
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c index 0ffde69c8d01..346a4e025c34 100644 --- a/drivers/net/ethernet/natsemi/macsonic.c +++ b/drivers/net/ethernet/natsemi/macsonic.c | |||
| @@ -202,13 +202,13 @@ static int macsonic_init(struct net_device *dev) | |||
| 202 | 202 | ||
| 203 | /* Allocate the entire chunk of memory for the descriptors. | 203 | /* Allocate the entire chunk of memory for the descriptors. |
| 204 | Note that this cannot cross a 64K boundary. */ | 204 | Note that this cannot cross a 64K boundary. */ |
| 205 | if ((lp->descriptors = dma_alloc_coherent(lp->device, | 205 | lp->descriptors = dma_alloc_coherent(lp->device, |
| 206 | SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), | 206 | SIZEOF_SONIC_DESC * |
| 207 | &lp->descriptors_laddr, GFP_KERNEL)) == NULL) { | 207 | SONIC_BUS_SCALE(lp->dma_bitmode), |
| 208 | printk(KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n", | 208 | &lp->descriptors_laddr, |
| 209 | dev_name(lp->device)); | 209 | GFP_KERNEL); |
| 210 | if (lp->descriptors == NULL) | ||
| 210 | return -ENOMEM; | 211 | return -ENOMEM; |
| 211 | } | ||
| 212 | 212 | ||
| 213 | /* Now set up the pointers to point to the appropriate places */ | 213 | /* Now set up the pointers to point to the appropriate places */ |
| 214 | lp->cda = lp->descriptors; | 214 | lp->cda = lp->descriptors; |
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c index 5e4748e855f6..c2e0256fe3df 100644 --- a/drivers/net/ethernet/natsemi/xtsonic.c +++ b/drivers/net/ethernet/natsemi/xtsonic.c | |||
| @@ -197,14 +197,12 @@ static int __init sonic_probe1(struct net_device *dev) | |||
| 197 | * We also allocate extra space for a pointer to allow freeing | 197 | * We also allocate extra space for a pointer to allow freeing |
| 198 | * this structure later on (in xtsonic_cleanup_module()). | 198 | * this structure later on (in xtsonic_cleanup_module()). |
| 199 | */ | 199 | */ |
| 200 | lp->descriptors = | 200 | lp->descriptors = dma_alloc_coherent(lp->device, |
| 201 | dma_alloc_coherent(lp->device, | 201 | SIZEOF_SONIC_DESC * |
| 202 | SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), | 202 | SONIC_BUS_SCALE(lp->dma_bitmode), |
| 203 | &lp->descriptors_laddr, GFP_KERNEL); | 203 | &lp->descriptors_laddr, |
| 204 | 204 | GFP_KERNEL); | |
| 205 | if (lp->descriptors == NULL) { | 205 | if (lp->descriptors == NULL) { |
| 206 | printk(KERN_ERR "%s: couldn't alloc DMA memory for " | ||
| 207 | " descriptors.\n", dev_name(lp->device)); | ||
| 208 | err = -ENOMEM; | 206 | err = -ENOMEM; |
| 209 | goto out; | 207 | goto out; |
| 210 | } | 208 | } |
