lkml.org 
[lkml]   [2017]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 19/29] x86/insn-eval: Add support to resolve 32-bit address encodings
On Tue, Oct 03, 2017 at 08:54:22PM -0700, Ricardo Neri wrote:
> The new function get_addr_ref_32() is almost identical to the existing
> function insn_get_addr_ref() (used for 64-bit addresses); except for the
> differences mentioned above. For the sake of simplicity and readability,
> it is better to use two separate functions.

You're kidding, right?

You're not adding another small function - this new one is just as big. And
almost identical.

So if you split the whole handling into helpers - for example, each
if-clause is doing very similar things - you can carve out the repeating
pieces into helpers and then call them each time with the respective
parameters, you can get rid of all that needless duplication.

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--

\
 
 \ /
  Last update: 2017-10-22 17:46    [W:0.594 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site