
29 Sep
2020
29 Sep
'20
10:20 p.m.
On 9/29/20 10:03 PM, Heinrich Schuchardt wrote:
void * can be assigned to any pointer variable. Avoid unnecessary conversions.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
drivers/usb/host/xhci-mem.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 1da0524aa0..4c303ae705 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -280,10 +280,10 @@ static struct xhci_segment *xhci_segment_alloc(void) { struct xhci_segment *seg;
- seg = (struct xhci_segment *)malloc(sizeof(struct xhci_segment));
- seg = malloc(sizeof(struct xhci_segment));
As far as I remember, the compiler used to complain about assignment from a different type without a cast ?
btw. you might also do a patch which does malloc(sizeof(*seg)); while at it.