diff mbox series

usb: gadget: remove useless cast

Message ID 20210731171838.GA912463@pc
State New
Headers show
Series usb: gadget: remove useless cast | expand

Commit Message

Salah Triki July 31, 2021, 5:18 p.m. UTC
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(-)

Comments

Felipe Balbi Aug. 2, 2021, 8:26 a.m. UTC | #1
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
diff mbox series

Patch

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