staging: ozwpan: use kmalloc_array over kmalloc with multiply
Cleanup checkpatch.pl warnings.
---
Somehow I missed the comment Tobias made on the line indentation. I fixed the patch, and added here as a reply - the previous patch should be ignored.
drivers/staging/ozwpan/ozhcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/ozwpan/ozhcd.c +2 -2
@@ -1315,8 +1315,8 @@ static int oz_build_endpoints_for_config(struct usb_hcd *hcd,if (num_iface) {struct oz_interface *iface; - iface =kmalloc (num_iface*sizeof (struct oz_interface ), - mem_flags | __GFP_ZERO); + iface =kmalloc_array (num_iface,sizeof (struct oz_interface ), + mem_flags | __GFP_ZERO);if (!iface)return -ENOMEM ;spin_lock_bh (&ozhcd->hcd_lock);
--
2.0.1
Quoted 1 line · Adrian Nicoara
Cleanup checkpatch.pl warnings.
Please state which warning this is fixing. Same goes for patches 1-3.
Quoted 14 lines
Signed-off-by Adrian Nicoara <[email protected]>---
Somehow I missed the comment Tobias made on the line indentation. I fixed the patch, and added here as a reply - the previous patch should be ignored.
drivers/staging/ozwpan/ozhcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/ozwpan/ozhcd.c +0
-0
drivers/staging/ozwpan/ozhcd.c static int oz_build_endpoints_for_config(struct usb_hcd *hcd, · line 1319
Quoted 7 lines
drivers/staging/ozwpan/ozhcd.c +2
-2@@ -1315,8 +1315,8 @@ static int oz_build_endpoints_for_config(struct usb_hcd *hcd,if (num_iface) {struct oz_interface *iface; - iface =kmalloc (num_iface*sizeof (struct oz_interface ), - mem_flags | __GFP_ZERO); + iface =kmalloc_array (num_iface,sizeof (struct oz_interface ), + mem_flags | __GFP_ZERO);
This still isn't entirely correct. It should rather look like this:
iface = kmalloc_array(num_iface, sizeof(struct oz_interface), mem_flags | __GFP_ZERO);
Assume a tab width of 8 (as per CodingStyle) and use spaces to get the alignment right.
Quoted 6 lines
drivers/staging/ozwpan/ozhcd.c +0
-1if (!iface)return -ENOMEM ;spin_lock_bh (&ozhcd->hcd_lock); --2.0.1
Quoted 16 lines · Adrian Nicoara
Cleanup checkpatch.pl warnings.
Signed-off-by Adrian Nicoara <[email protected]>---
Somehow I missed the comment Tobias made on the line indentation. I fixed the patch, and added here as a reply - the previous patch should be ignored.
drivers/staging/ozwpan/ozhcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/ozwpan/ozhcd.c +0
-0
drivers/staging/ozwpan/ozhcd.c static int oz_build_endpoints_for_config(struct usb_hcd *hcd, · line 1319
Quoted 7 lines
drivers/staging/ozwpan/ozhcd.c +2
-2@@ -1315,8 +1315,8 @@ static int oz_build_endpoints_for_config(struct usb_hcd *hcd,if (num_iface) {struct oz_interface *iface; - iface =kmalloc (num_iface*sizeof (struct oz_interface ), - mem_flags | __GFP_ZERO); + iface =kmalloc_array (num_iface,sizeof (struct oz_interface ), + mem_flags | __GFP_ZERO);
Still not lined up correctly. The spacing should be:
iface = kmalloc_array(num_iface, sizeof(struct oz_interface), mem_flags | __GFP_ZERO);
[tab][tab][tab][tab][space][space][space][space][space][space]mem_flags...
regards,
dan carpenter