mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@acm.org>
To: broonie@kernel.org, gregkh@linuxfoundation.org
Cc: salah.triki@acm.org, linux-kernel@vger.kernel.org
Subject: [PATCH] regmap: Remove useless check
Date: Fri,  7 Aug 2015 18:33:36 +0100	[thread overview]
Message-ID: <1438968816-5370-1-git-send-email-salah.triki@acm.org> (raw)

lzo1x_1_do_compress always returns LZO_E_OK. Thus, the check of the
return value is useless.

Signed-off-by: Salah Triki <salah.triki@acm.org>
---
 drivers/base/regmap/regcache-lzo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/base/regmap/regcache-lzo.c b/drivers/base/regmap/regcache-lzo.c
index 2d53f6f..67245d0 100644
--- a/drivers/base/regmap/regcache-lzo.c
+++ b/drivers/base/regmap/regcache-lzo.c
@@ -46,11 +46,10 @@ static int regcache_lzo_prepare(struct regcache_lzo_ctx *lzo_ctx)
 static int regcache_lzo_compress(struct regcache_lzo_ctx *lzo_ctx)
 {
 	size_t compress_size;
-	int ret;
 
-	ret = lzo1x_1_compress(lzo_ctx->src, lzo_ctx->src_len,
+	lzo1x_1_compress(lzo_ctx->src, lzo_ctx->src_len,
 			       lzo_ctx->dst, &compress_size, lzo_ctx->wmem);
-	if (ret != LZO_E_OK || compress_size > lzo_ctx->dst_len)
+	if (compress_size > lzo_ctx->dst_len)
 		return -EINVAL;
 	lzo_ctx->dst_len = compress_size;
 	return 0;
-- 
1.9.1


             reply	other threads:[~2015-08-07 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 17:33 Salah Triki [this message]
2015-08-07 18:27 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438968816-5370-1-git-send-email-salah.triki@acm.org \
    --to=salah.triki@acm.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®