From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
kernel@collabora.com, kernel-janitors@vger.kernel.org,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] spi: Remove the dead code
Date: Tue, 4 Oct 2022 10:56:20 +0500 [thread overview]
Message-ID: <20221004055620.371732-1-usama.anjum@collabora.com> (raw)
The vmallocated_buf is being checked if it is true inside the body of a
if condition which has already checked if it is true. Remove the
duplication and dead code as a result.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
drivers/spi/spi.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 44e4352d948b..4c51cd4e4ab0 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1057,10 +1057,7 @@ static int spi_map_buf_attrs(struct spi_controller *ctlr, struct device *dev,
min = min_t(size_t, desc_len,
min_t(size_t, len,
PAGE_SIZE - offset_in_page(buf)));
- if (vmalloced_buf)
- vm_page = vmalloc_to_page(buf);
- else
- vm_page = kmap_to_page(buf);
+ vm_page = vmalloc_to_page(buf);
if (!vm_page) {
sg_free_table(sgt);
return -ENOMEM;
--
2.30.2
next reply other threads:[~2022-10-04 5:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 5:56 Muhammad Usama Anjum [this message]
2022-10-04 11:09 ` Muhammad Usama Anjum
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=20221004055620.371732-1-usama.anjum@collabora.com \
--to=usama.anjum@collabora.com \
--cc=broonie@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@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®