From: Salah Triki <salah.triki@gmail.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Peter Chen <peter.chen@nxp.com>, Jack Pham <jackp@codeaurora.org>,
Wesley Cheng <wcheng@codeaurora.org>,
kernel test robot <lkp@intel.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Dean Anderson <dean@sensoray.com>,
Andrew Gabbasov <andrew_gabbasov@mentor.com>,
Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: gadget: remove useless cast
Date: Sat, 31 Jul 2021 18:18:38 +0100 [thread overview]
Message-ID: <20210731171838.GA912463@pc> (raw)
Remove the cast done by ERR_PTR() and PTR_ERR() since data is of type char
* and fss_prepare_buffer() should returns a value of this type.
Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
drivers/usb/gadget/function/f_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 9c0c393abb39..e411555e4c34 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -3831,7 +3831,7 @@ static char *ffs_prepare_buffer(const char __user *buf, size_t len)
data = memdup_user(buf, len);
if (IS_ERR(data))
- return ERR_PTR(PTR_ERR(data));
+ return data;
pr_vdebug("Buffer from user space:\n");
ffs_dump_mem("", data, len);
--
2.25.1
next reply other threads:[~2021-07-31 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-31 17:18 Salah Triki [this message]
2021-08-02 8:26 ` [PATCH] usb: gadget: remove useless cast Felipe Balbi
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=20210731171838.GA912463@pc \
--to=salah.triki@gmail.com \
--cc=andrew_gabbasov@mentor.com \
--cc=balbi@kernel.org \
--cc=dean@sensoray.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=jackp@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lkp@intel.com \
--cc=peter.chen@nxp.com \
--cc=vskrishn@codeaurora.org \
--cc=wcheng@codeaurora.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;
as well as URLs for NNTP newsgroup(s).