diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-06-07 19:01:54 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:05 -0400 |
commit | 0870066d7e6c85bbe37741137e4c4731501a98e0 (patch) | |
tree | 20b0c0e2417b222d18d0027e067dc55489db0940 /drivers | |
parent | 96166056076af59d40e5b5aec5b09611c74cc911 (diff) |
mtd: remove printk's for [kv][mz]alloc failures
When a memory allocation fails, the kernel will print out a backtrace
automatically. These print statements are unnecessary.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/cmdlinepart.c | 3 | ||||
-rw-r--r-- | drivers/mtd/inftlcore.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 13 | ||||
-rw-r--r-- | drivers/mtd/nand/rtc_from4.c | 1 | ||||
-rw-r--r-- | drivers/mtd/nftlcore.c | 4 | ||||
-rw-r--r-- | drivers/mtd/onenand/onenand_bbt.c | 4 | ||||
-rw-r--r-- | drivers/mtd/ssfdc.c | 10 |
7 files changed, 8 insertions, 31 deletions
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index e790f38893b0..be0c121f2f1b 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c | |||
@@ -188,10 +188,7 @@ static struct mtd_partition * newpart(char *s, | |||
188 | extra_mem_size; | 188 | extra_mem_size; |
189 | parts = kzalloc(alloc_size, GFP_KERNEL); | 189 | parts = kzalloc(alloc_size, GFP_KERNEL); |
190 | if (!parts) | 190 | if (!parts) |
191 | { | ||
192 | printk(KERN_ERR ERRP "out of memory\n"); | ||
193 | return NULL; | 191 | return NULL; |
194 | } | ||
195 | extra_mem = (unsigned char *)(parts + *num_parts); | 192 | extra_mem = (unsigned char *)(parts + *num_parts); |
196 | } | 193 | } |
197 | /* enter this partition (offset will be calculated later if it is zero at this point) */ | 194 | /* enter this partition (offset will be calculated later if it is zero at this point) */ |
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index d7592e67d048..c9a31e6faab2 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c | |||
@@ -67,10 +67,8 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
67 | 67 | ||
68 | inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); | 68 | inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); |
69 | 69 | ||
70 | if (!inftl) { | 70 | if (!inftl) |
71 | printk(KERN_WARNING "INFTL: Out of memory for data structures\n"); | ||
72 | return; | 71 | return; |
73 | } | ||
74 | 72 | ||
75 | inftl->mbd.mtd = mtd; | 73 | inftl->mbd.mtd = mtd; |
76 | inftl->mbd.devnum = -1; | 74 | inftl->mbd.devnum = -1; |
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index ba401662835e..8875d6db2455 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -1121,10 +1121,8 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | |||
1121 | * table. | 1121 | * table. |
1122 | */ | 1122 | */ |
1123 | this->bbt = kzalloc(len, GFP_KERNEL); | 1123 | this->bbt = kzalloc(len, GFP_KERNEL); |
1124 | if (!this->bbt) { | 1124 | if (!this->bbt) |
1125 | printk(KERN_ERR "nand_scan_bbt: Out of memory\n"); | ||
1126 | return -ENOMEM; | 1125 | return -ENOMEM; |
1127 | } | ||
1128 | 1126 | ||
1129 | /* | 1127 | /* |
1130 | * If no primary table decriptor is given, scan the device to build a | 1128 | * If no primary table decriptor is given, scan the device to build a |
@@ -1146,7 +1144,6 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | |||
1146 | len += (len >> this->page_shift) * mtd->oobsize; | 1144 | len += (len >> this->page_shift) * mtd->oobsize; |
1147 | buf = vmalloc(len); | 1145 | buf = vmalloc(len); |
1148 | if (!buf) { | 1146 | if (!buf) { |
1149 | printk(KERN_ERR "nand_bbt: Out of memory\n"); | ||
1150 | kfree(this->bbt); | 1147 | kfree(this->bbt); |
1151 | this->bbt = NULL; | 1148 | this->bbt = NULL; |
1152 | return -ENOMEM; | 1149 | return -ENOMEM; |
@@ -1195,10 +1192,8 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs) | |||
1195 | len = (1 << this->bbt_erase_shift); | 1192 | len = (1 << this->bbt_erase_shift); |
1196 | len += (len >> this->page_shift) * mtd->oobsize; | 1193 | len += (len >> this->page_shift) * mtd->oobsize; |
1197 | buf = kmalloc(len, GFP_KERNEL); | 1194 | buf = kmalloc(len, GFP_KERNEL); |
1198 | if (!buf) { | 1195 | if (!buf) |
1199 | printk(KERN_ERR "nand_update_bbt: Out of memory\n"); | ||
1200 | return -ENOMEM; | 1196 | return -ENOMEM; |
1201 | } | ||
1202 | 1197 | ||
1203 | writeops = md != NULL ? 0x03 : 0x01; | 1198 | writeops = md != NULL ? 0x03 : 0x01; |
1204 | 1199 | ||
@@ -1307,10 +1302,8 @@ static int nand_create_default_bbt_descr(struct nand_chip *this) | |||
1307 | return -EINVAL; | 1302 | return -EINVAL; |
1308 | } | 1303 | } |
1309 | bd = kzalloc(sizeof(*bd), GFP_KERNEL); | 1304 | bd = kzalloc(sizeof(*bd), GFP_KERNEL); |
1310 | if (!bd) { | 1305 | if (!bd) |
1311 | printk(KERN_ERR "nand_create_default_bbt_descr: Out of memory\n"); | ||
1312 | return -ENOMEM; | 1306 | return -ENOMEM; |
1313 | } | ||
1314 | bd->options = this->bbt_options; | 1307 | bd->options = this->bbt_options; |
1315 | bd->offs = this->badblockpos; | 1308 | bd->offs = this->badblockpos; |
1316 | bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1; | 1309 | bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1; |
diff --git a/drivers/mtd/nand/rtc_from4.c b/drivers/mtd/nand/rtc_from4.c index c9f9127ff770..a07da2a3beee 100644 --- a/drivers/mtd/nand/rtc_from4.c +++ b/drivers/mtd/nand/rtc_from4.c | |||
@@ -444,7 +444,6 @@ static int rtc_from4_errstat(struct mtd_info *mtd, struct nand_chip *this, | |||
444 | len = mtd->writesize; | 444 | len = mtd->writesize; |
445 | buf = kmalloc(len, GFP_KERNEL); | 445 | buf = kmalloc(len, GFP_KERNEL); |
446 | if (!buf) { | 446 | if (!buf) { |
447 | printk(KERN_ERR "rtc_from4_errstat: Out of memory!\n"); | ||
448 | er_stat = 1; | 447 | er_stat = 1; |
449 | goto out; | 448 | goto out; |
450 | } | 449 | } |
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index b155666acfbe..f3b3239746c8 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c | |||
@@ -67,10 +67,8 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
67 | 67 | ||
68 | nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL); | 68 | nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL); |
69 | 69 | ||
70 | if (!nftl) { | 70 | if (!nftl) |
71 | printk(KERN_WARNING "NFTL: out of memory for data structures\n"); | ||
72 | return; | 71 | return; |
73 | } | ||
74 | 72 | ||
75 | nftl->mbd.mtd = mtd; | 73 | nftl->mbd.mtd = mtd; |
76 | nftl->mbd.devnum = -1; | 74 | nftl->mbd.devnum = -1; |
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c index fc2c16a0fd1c..09a7d1fb511d 100644 --- a/drivers/mtd/onenand/onenand_bbt.c +++ b/drivers/mtd/onenand/onenand_bbt.c | |||
@@ -188,10 +188,8 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | |||
188 | len = this->chipsize >> (this->erase_shift + 2); | 188 | len = this->chipsize >> (this->erase_shift + 2); |
189 | /* Allocate memory (2bit per block) and clear the memory bad block table */ | 189 | /* Allocate memory (2bit per block) and clear the memory bad block table */ |
190 | bbm->bbt = kzalloc(len, GFP_KERNEL); | 190 | bbm->bbt = kzalloc(len, GFP_KERNEL); |
191 | if (!bbm->bbt) { | 191 | if (!bbm->bbt) |
192 | printk(KERN_ERR "onenand_scan_bbt: Out of memory\n"); | ||
193 | return -ENOMEM; | 192 | return -ENOMEM; |
194 | } | ||
195 | 193 | ||
196 | /* Set the bad block position */ | 194 | /* Set the bad block position */ |
197 | bbm->badblockpos = ONENAND_BADBLOCK_POS; | 195 | bbm->badblockpos = ONENAND_BADBLOCK_POS; |
diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index 5cd189793332..00d1405af50b 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c | |||
@@ -304,11 +304,8 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
304 | return; | 304 | return; |
305 | 305 | ||
306 | ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); | 306 | ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); |
307 | if (!ssfdc) { | 307 | if (!ssfdc) |
308 | printk(KERN_WARNING | ||
309 | "SSFDC_RO: out of memory for data structures\n"); | ||
310 | return; | 308 | return; |
311 | } | ||
312 | 309 | ||
313 | ssfdc->mbd.mtd = mtd; | 310 | ssfdc->mbd.mtd = mtd; |
314 | ssfdc->mbd.devnum = -1; | 311 | ssfdc->mbd.devnum = -1; |
@@ -342,11 +339,8 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
342 | /* Allocate logical block map */ | 339 | /* Allocate logical block map */ |
343 | ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) * | 340 | ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) * |
344 | ssfdc->map_len, GFP_KERNEL); | 341 | ssfdc->map_len, GFP_KERNEL); |
345 | if (!ssfdc->logic_block_map) { | 342 | if (!ssfdc->logic_block_map) |
346 | printk(KERN_WARNING | ||
347 | "SSFDC_RO: out of memory for data structures\n"); | ||
348 | goto out_err; | 343 | goto out_err; |
349 | } | ||
350 | memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) * | 344 | memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) * |
351 | ssfdc->map_len); | 345 | ssfdc->map_len); |
352 | 346 | ||