diff options
author | Joe Perches <joe@perches.com> | 2014-02-21 01:25:51 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-26 02:36:35 +0400 |
commit | cd2b0389dc304c6a7fa2ebae200f246059c68dd9 (patch) | |
tree | 6ca645d573cebfe45567671df3ef989549ba45c2 /include/uapi | |
parent | 51adfcc333e1490d3a22490f5b3504f64c7b28b4 (diff) | |
download | linux-cd2b0389dc304c6a7fa2ebae200f246059c68dd9.tar.xz |
bnx2x: Remove hidden flow control goto from BNX2X_ALLOC macros
BNX2X_ALLOC macros use "goto alloc_mem_err"
so these labels appear unused in some functions.
Expand these macros in-place via coccinelle and
some typing.
Update the macros to use statement expressions
and remove the BNX2X_ALLOC macro.
This adds some > 80 char lines.
$ cat bnx2x_pci_alloc.cocci
@@
expression e1;
expression e2;
expression e3;
@@
- BNX2X_PCI_ALLOC(e1, e2, e3);
+ e1 = BNX2X_PCI_ALLOC(e2, e3); if (!e1) goto alloc_mem_err;
@@
expression e1;
expression e2;
expression e3;
@@
- BNX2X_PCI_FALLOC(e1, e2, e3);
+ e1 = BNX2X_PCI_FALLOC(e2, e3); if (!e1) goto alloc_mem_err;
@@
expression e1;
expression e2;
@@
- BNX2X_ALLOC(e1, e2);
+ e1 = kzalloc(e2, GFP_KERNEL); if (!e1) goto alloc_mem_err;
@@
expression e1;
expression e2;
expression e3;
@@
- kzalloc(sizeof(e1) * e2, e3)
+ kcalloc(e2, sizeof(e1), e3)
@@
expression e1;
expression e2;
expression e3;
@@
- kzalloc(e1 * sizeof(e2), e3)
+ kcalloc(e1, sizeof(e2), e3)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions