diff options
author | Jonathan Corbet <corbet@lwn.net> | 2009-08-04 21:35:17 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-05 00:33:46 +0200 |
commit | 07868201070d87484bd00610a4921e879be78746 (patch) | |
tree | 262e32d1261bf05280a9711f6aa951550343979e /lib/flex_array.c | |
parent | Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/l... (diff) | |
download | linux-07868201070d87484bd00610a4921e879be78746.tar.xz linux-07868201070d87484bd00610a4921e879be78746.zip |
flex_array: remove unneeded index calculation
flex_array_get() calculates an index value, then drops it on the floor;
simply remove it.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/flex_array.c')
-rw-r--r-- | lib/flex_array.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/flex_array.c b/lib/flex_array.c index 0e7894ce8882..08f1636d296a 100644 --- a/lib/flex_array.c +++ b/lib/flex_array.c @@ -254,7 +254,6 @@ void *flex_array_get(struct flex_array *fa, int element_nr) { int part_nr = fa_element_to_part_nr(fa, element_nr); struct flex_array_part *part; - int index; if (element_nr >= fa->total_nr_elements) return NULL; @@ -264,6 +263,5 @@ void *flex_array_get(struct flex_array *fa, int element_nr) part = (struct flex_array_part *)&fa->parts[0]; else part = fa->parts[part_nr]; - index = index_inside_part(fa, element_nr); return &part->elements[index_inside_part(fa, element_nr)]; } |