lkml.org 
[lkml]   [2016]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection
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


\
 
 \ /
  Last update: 2016-01-01 16:01    [W:0.375 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site