public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Mathieu Malaterre <malat@debian•org>
To: Frederic Barrat <fbarrat@linux•vnet.ibm.com>
Cc: Christophe Lombard <clombard@linux•vnet.ibm.com>,
	linuxppc-dev@lists•ozlabs.org,
	Andrew Donnellan <andrew.donnellan@au1•ibm.com>,
	Mathieu Malaterre <malat@debian•org>
Subject: [PATCH] cxl: remove a dead branch
Date: Thu, 22 Mar 2018 22:05:28 +0100	[thread overview]
Message-ID: <20180322210528.22017-1-malat@debian.org> (raw)

In commit 14baf4d9c739 ("cxl: Add guest-specific code") the following code
was added:

	if (afu->crs_len < 0) {
		dev_err(&afu->dev, "Unexpected configuration record size value\n");
		return -EINVAL;
	}

However the variable `crs_len` is of type u64 and cannot be compared < 0.
Remove the dead code section. Fix the following warning treated as error
with W=1:

../drivers/misc/cxl/guest.c:919:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]

Signed-off-by: Mathieu Malaterre <malat@debian•org>
---
 drivers/misc/cxl/guest.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c
index f58b4b6c79f2..48103fcff0b5 100644
--- a/drivers/misc/cxl/guest.c
+++ b/drivers/misc/cxl/guest.c
@@ -916,11 +916,6 @@ static int afu_properties_look_ok(struct cxl_afu *afu)
 		return -EINVAL;
 	}
 
-	if (afu->crs_len < 0) {
-		dev_err(&afu->dev, "Unexpected configuration record size value\n");
-		return -EINVAL;
-	}
-
 	return 0;
 }
 
-- 
2.11.0

             reply	other threads:[~2018-03-22 21:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 21:05 Mathieu Malaterre [this message]
2018-03-27 16:53 ` [PATCH] cxl: remove a dead branch Frederic Barrat
2018-08-13 11:22 ` Michael Ellerman
2018-08-13 11:25   ` Mathieu Malaterre
2018-08-14  4:13     ` Michael Ellerman

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=20180322210528.22017-1-malat@debian.org \
    --to=malat@debian$(echo .)org \
    --cc=andrew.donnellan@au1$(echo .)ibm.com \
    --cc=clombard@linux$(echo .)vnet.ibm.com \
    --cc=fbarrat@linux$(echo .)vnet.ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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