Commit 0870066d7e6c85bbe37741137e4c4731501a98e0
Committed by
Artem Bityutskiy
1 parent
9616605607
Exists in
master
and in
20 other branches
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>
Showing 7 changed files with 8 additions and 31 deletions Side-by-side Diff
drivers/mtd/cmdlinepart.c
... | ... | @@ -188,10 +188,7 @@ |
188 | 188 | extra_mem_size; |
189 | 189 | parts = kzalloc(alloc_size, GFP_KERNEL); |
190 | 190 | if (!parts) |
191 | - { | |
192 | - printk(KERN_ERR ERRP "out of memory\n"); | |
193 | 191 | return NULL; |
194 | - } | |
195 | 192 | extra_mem = (unsigned char *)(parts + *num_parts); |
196 | 193 | } |
197 | 194 | /* enter this partition (offset will be calculated later if it is zero at this point) */ |
drivers/mtd/inftlcore.c
drivers/mtd/nand/nand_bbt.c
... | ... | @@ -1121,10 +1121,8 @@ |
1121 | 1121 | * table. |
1122 | 1122 | */ |
1123 | 1123 | this->bbt = kzalloc(len, GFP_KERNEL); |
1124 | - if (!this->bbt) { | |
1125 | - printk(KERN_ERR "nand_scan_bbt: Out of memory\n"); | |
1124 | + if (!this->bbt) | |
1126 | 1125 | return -ENOMEM; |
1127 | - } | |
1128 | 1126 | |
1129 | 1127 | /* |
1130 | 1128 | * If no primary table decriptor is given, scan the device to build a |
... | ... | @@ -1146,7 +1144,6 @@ |
1146 | 1144 | len += (len >> this->page_shift) * mtd->oobsize; |
1147 | 1145 | buf = vmalloc(len); |
1148 | 1146 | if (!buf) { |
1149 | - printk(KERN_ERR "nand_bbt: Out of memory\n"); | |
1150 | 1147 | kfree(this->bbt); |
1151 | 1148 | this->bbt = NULL; |
1152 | 1149 | return -ENOMEM; |
1153 | 1150 | |
... | ... | @@ -1195,10 +1192,8 @@ |
1195 | 1192 | len = (1 << this->bbt_erase_shift); |
1196 | 1193 | len += (len >> this->page_shift) * mtd->oobsize; |
1197 | 1194 | buf = kmalloc(len, GFP_KERNEL); |
1198 | - if (!buf) { | |
1199 | - printk(KERN_ERR "nand_update_bbt: Out of memory\n"); | |
1195 | + if (!buf) | |
1200 | 1196 | return -ENOMEM; |
1201 | - } | |
1202 | 1197 | |
1203 | 1198 | writeops = md != NULL ? 0x03 : 0x01; |
1204 | 1199 | |
1205 | 1200 | |
... | ... | @@ -1307,10 +1302,8 @@ |
1307 | 1302 | return -EINVAL; |
1308 | 1303 | } |
1309 | 1304 | bd = kzalloc(sizeof(*bd), GFP_KERNEL); |
1310 | - if (!bd) { | |
1311 | - printk(KERN_ERR "nand_create_default_bbt_descr: Out of memory\n"); | |
1305 | + if (!bd) | |
1312 | 1306 | return -ENOMEM; |
1313 | - } | |
1314 | 1307 | bd->options = this->bbt_options; |
1315 | 1308 | bd->offs = this->badblockpos; |
1316 | 1309 | bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1; |
drivers/mtd/nand/rtc_from4.c
drivers/mtd/nftlcore.c
drivers/mtd/onenand/onenand_bbt.c
... | ... | @@ -188,10 +188,8 @@ |
188 | 188 | len = this->chipsize >> (this->erase_shift + 2); |
189 | 189 | /* Allocate memory (2bit per block) and clear the memory bad block table */ |
190 | 190 | bbm->bbt = kzalloc(len, GFP_KERNEL); |
191 | - if (!bbm->bbt) { | |
192 | - printk(KERN_ERR "onenand_scan_bbt: Out of memory\n"); | |
191 | + if (!bbm->bbt) | |
193 | 192 | return -ENOMEM; |
194 | - } | |
195 | 193 | |
196 | 194 | /* Set the bad block position */ |
197 | 195 | bbm->badblockpos = ONENAND_BADBLOCK_POS; |
drivers/mtd/ssfdc.c
... | ... | @@ -304,11 +304,8 @@ |
304 | 304 | return; |
305 | 305 | |
306 | 306 | ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); |
307 | - if (!ssfdc) { | |
308 | - printk(KERN_WARNING | |
309 | - "SSFDC_RO: out of memory for data structures\n"); | |
307 | + if (!ssfdc) | |
310 | 308 | return; |
311 | - } | |
312 | 309 | |
313 | 310 | ssfdc->mbd.mtd = mtd; |
314 | 311 | ssfdc->mbd.devnum = -1; |
315 | 312 | |
... | ... | @@ -342,11 +339,8 @@ |
342 | 339 | /* Allocate logical block map */ |
343 | 340 | ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) * |
344 | 341 | ssfdc->map_len, GFP_KERNEL); |
345 | - if (!ssfdc->logic_block_map) { | |
346 | - printk(KERN_WARNING | |
347 | - "SSFDC_RO: out of memory for data structures\n"); | |
342 | + if (!ssfdc->logic_block_map) | |
348 | 343 | goto out_err; |
349 | - } | |
350 | 344 | memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) * |
351 | 345 | ssfdc->map_len); |
352 | 346 |