Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1299933
| From | Francois Romieu <romieu@fr.zoreil.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection |
| Date | 2016-01-01 15:50 +0100 |
| Message-ID | <qM9bI-3FN-23@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <qM6Qy-2kR-5@gated-at.bofh.it> <qM70e-2ob-13@gated-at.bofh.it> <qM79U-2rl-7@gated-at.bofh.it> <qM7tf-2y5-1@gated-at.bofh.it> <qM7CW-2R6-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Julia Lawall <julia.lawall@lip6.fr> :
> On Fri, 1 Jan 2016, SF Markus Elfring wrote:
[...]
> > > Normally, one returns -ENOMEM for this case, but it looks like this
> > > function is returning 0 on failure.
> >
> > Should a symbol like "false" be used instead of such a special number?
>
> Maybe it's better than 0 and 1...
Your suggestion about -ENOMEM is consistent with the callchain. Nothing
else is needed.
Btw:
1. kfree does not care about NULL parameter, especially in this hardly
timing sensitive path.
2. kmalloc_array for small kernel controlled arrays of integers (see
drivers/net/ethernet/freescale/gianfar.h), seriously ?
I'd suggest the janitor to introduce a dedicated struct to embed both
gfar_private.ftp_rqf{p, c}r then use a single, plain kmalloc in
gfar_ethflow_to_filer_table.
Happy tasteful 2016 :o)
--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] net-gianfar: Fine-tuning for gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:20 +0100
[PATCH 2/3] net-gianfar: Delete unnecessary variable initialisations in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
[PATCH 3/3] net-gianfar: Extend an initialisation clause of a for loop in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
[PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection Julia Lawall <julia.lawall@lip6.fr> - 2016-01-01 13:40 +0100
Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 14:00 +0100
Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection Julia Lawall <julia.lawall@lip6.fr> - 2016-01-01 14:10 +0100
Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection Francois Romieu <romieu@fr.zoreil.com> - 2016-01-01 15:50 +0100
[PATCH v2 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 14:10 +0100
Re: [PATCH v2 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection David Miller <davem@davemloft.net> - 2016-01-02 04:20 +0100
csiph-web