On Thu, 22 Feb 2018 02:33:08 +0000, Alex Arvelaez said:
Hello,
I'd like to contribute to the linux kernel eventually but I'm not sure
https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.ht...
how, I grabbed a copy of the source code and I found a FIXME that looks like I could fix:
/* File: /usr/src/linux/tools/perf/util/string.c * FIXME: replace this with an expression using log10() when we * find a suitable implementation, maybe the one in the dvb drivers... */
Step 0: Verify that the comment still matches the code, *and* that the change is still desired. Hint: Why do they want log10()? What does the current code do? What, if anything, will break if you change it? Do you understand *why* '28' was used? And why they didn't just go ahead and use the perfectly usable log10() found in -lm ? For bonus points, understand the code's behavior (or misbehavior) on 32 versus 64 bit architectures, and whether or not that's actually a problem. For extra bonus points, figure out how long that FIXME has been there. And why. (Note that some of these are things that I don't know the answer to offhand. ;)
I found the implementation they mention, is it okay to just copy paste it into the file? I'm not sure where else to ask this kind of question...
If it's going to be used in more than one place, it should be refactored into a function, and both usage sites reworked to call the function rather than inline.