@@ -80,10 +80,8 @@ static int jffs2_selected_compress(u8 compr, unsigned char *data_in,
char *output_buf;
output_buf = kmalloc(*cdatalen, GFP_KERNEL);
- if (!output_buf) {
- pr_warn("No memory for compressor allocation. Compression failed.\n");
+ if (!output_buf)
return ret;
- }
orig_slen = *datalen;
orig_dlen = *cdatalen;
spin_lock(&jffs2_compressor_list_lock);
@@ -189,15 +187,11 @@ uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
spin_unlock(&jffs2_compressor_list_lock);
tmp_buf = kmalloc(orig_slen, GFP_KERNEL);
spin_lock(&jffs2_compressor_list_lock);
- if (!tmp_buf) {
- pr_warn("No memory for compressor allocation. (%d bytes)\n",
- orig_slen);
+ if (!tmp_buf)
continue;
- }
- else {
- this->compr_buf = tmp_buf;
- this->compr_buf_size = orig_slen;
- }
+
+ this->compr_buf = tmp_buf;
+ this->compr_buf_size = orig_slen;
}
this->usecount++;
spin_unlock(&jffs2_compressor_list_lock);
@@ -353,7 +353,6 @@ static int jffs2_symlink (struct user_namespace *mnt_userns, struct inode *dir_i
/* We use f->target field to store the target path. */
f->target = kmemdup(target, targetlen + 1, GFP_KERNEL);
if (!f->target) {
- pr_warn("Can't allocate %d bytes of memory\n", targetlen + 1);
mutex_unlock(&f->sem);
jffs2_complete_reservation(c);
ret = -ENOMEM;
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> --- fs/jffs2/compr.c | 16 +++++----------- fs/jffs2/dir.c | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/