linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: remove useless cast
@ 2021-07-31 17:18 Salah Triki
  2021-08-02  8:26 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Salah Triki @ 2021-07-31 17:18 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Peter Chen, Jack Pham,
	Wesley Cheng, kernel test robot, Gustavo A. R. Silva,
	Dean Anderson, Andrew Gabbasov, Vamsi Krishna Samavedam
  Cc: linux-usb, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: gadget: remove useless cast
  2021-07-31 17:18 [PATCH] usb: gadget: remove useless cast Salah Triki
@ 2021-08-02  8:26 ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-08-02  8:26 UTC (permalink / raw)
  To: Salah Triki
  Cc: Greg Kroah-Hartman, Peter Chen, Jack Pham, Wesley Cheng,
	kernel test robot, Gustavo A. R. Silva, Dean Anderson,
	Andrew Gabbasov, Vamsi Krishna Samavedam, linux-usb,
	linux-kernel


Salah Triki <salah.triki@gmail.com> writes:

> 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>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-02  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-31 17:18 [PATCH] usb: gadget: remove useless cast Salah Triki
2021-08-02  8:26 ` Felipe Balbi

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).