diff options
author | Joe Perches <joe@perches.com> | 2011-08-25 09:22:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-28 17:16:13 -0400 |
commit | 7ac2ed0ceeafa130f85aa947b271b571c68b9e75 (patch) | |
tree | 7f08a891990d46c84b0dd6b665fc0a70451fb6b2 /net/caif/cfcnfg.c | |
parent | 343e43c02850a3abcd22bd144e5bdbc92fdd273c (diff) |
caif: Remove OOM messages, use kzalloc
Remove per site OOM messages because they duplicate
the generic mm subsystem OOM message.
Use kzalloc instead of kmalloc/memset
when next to the OOM message removals.
Reduces object size (allyesconfig ~2%)
$ size -t drivers/net/caif/built-in.o.old net/caif/built-in.o.old
text data bss dec hex filename
32297 700 8224 41221 a105 drivers/net/caif/built-in.o.old
72159 1317 20552 94028 16f4c net/caif/built-in.o.old
104456 2017 28776 135249 21051 (TOTALS)
$ size -t drivers/net/caif/built-in.o.new net/caif/built-in.o.new
text data bss dec hex filename
31975 700 8184 40859 9f9b drivers/net/caif/built-in.o.new
70748 1317 20152 92217 16839 net/caif/built-in.o.new
102723 2017 28336 133076 207d4 (TOTALS)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfcnfg.c')
-rw-r--r-- | net/caif/cfcnfg.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 52fe33bee029..f07ab8c22224 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c | |||
@@ -78,10 +78,8 @@ struct cfcnfg *cfcnfg_create(void) | |||
78 | 78 | ||
79 | /* Initiate this layer */ | 79 | /* Initiate this layer */ |
80 | this = kzalloc(sizeof(struct cfcnfg), GFP_ATOMIC); | 80 | this = kzalloc(sizeof(struct cfcnfg), GFP_ATOMIC); |
81 | if (!this) { | 81 | if (!this) |
82 | pr_warn("Out of memory\n"); | ||
83 | return NULL; | 82 | return NULL; |
84 | } | ||
85 | this->mux = cfmuxl_create(); | 83 | this->mux = cfmuxl_create(); |
86 | if (!this->mux) | 84 | if (!this->mux) |
87 | goto out_of_mem; | 85 | goto out_of_mem; |
@@ -108,8 +106,6 @@ struct cfcnfg *cfcnfg_create(void) | |||
108 | 106 | ||
109 | return this; | 107 | return this; |
110 | out_of_mem: | 108 | out_of_mem: |
111 | pr_warn("Out of memory\n"); | ||
112 | |||
113 | synchronize_rcu(); | 109 | synchronize_rcu(); |
114 | 110 | ||
115 | kfree(this->mux); | 111 | kfree(this->mux); |
@@ -448,10 +444,8 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv, | |||
448 | "- unknown channel type\n"); | 444 | "- unknown channel type\n"); |
449 | goto unlock; | 445 | goto unlock; |
450 | } | 446 | } |
451 | if (!servicel) { | 447 | if (!servicel) |
452 | pr_warn("Out of memory\n"); | ||
453 | goto unlock; | 448 | goto unlock; |
454 | } | ||
455 | layer_set_dn(servicel, cnfg->mux); | 449 | layer_set_dn(servicel, cnfg->mux); |
456 | cfmuxl_set_uplayer(cnfg->mux, servicel, channel_id); | 450 | cfmuxl_set_uplayer(cnfg->mux, servicel, channel_id); |
457 | layer_set_up(servicel, adapt_layer); | 451 | layer_set_up(servicel, adapt_layer); |
@@ -497,10 +491,8 @@ got_phyid: | |||
497 | case CFPHYTYPE_FRAG: | 491 | case CFPHYTYPE_FRAG: |
498 | phy_driver = | 492 | phy_driver = |
499 | cfserl_create(CFPHYTYPE_FRAG, phyid, stx); | 493 | cfserl_create(CFPHYTYPE_FRAG, phyid, stx); |
500 | if (!phy_driver) { | 494 | if (!phy_driver) |
501 | pr_warn("Out of memory\n"); | ||
502 | goto out; | 495 | goto out; |
503 | } | ||
504 | break; | 496 | break; |
505 | case CFPHYTYPE_CAIF: | 497 | case CFPHYTYPE_CAIF: |
506 | phy_driver = NULL; | 498 | phy_driver = NULL; |
@@ -521,7 +513,6 @@ got_phyid: | |||
521 | frml = cffrml_create(phyid, fcs); | 513 | frml = cffrml_create(phyid, fcs); |
522 | 514 | ||
523 | if (!frml) { | 515 | if (!frml) { |
524 | pr_warn("Out of memory\n"); | ||
525 | kfree(phyinfo); | 516 | kfree(phyinfo); |
526 | goto out; | 517 | goto out; |
527 | } | 518 | } |