- 05 Oct, 2019 4 commits
-
-
Michael Heimpold authored
Appending multiple times to same string is slow since strcat() needs to determine the end during each run. So manually maintain a pointer to the end to speed-up things. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
When a hex-digit > 'a' or 'A' is read, we have to add an offset of 10 to access the valid symbol in our mapping table. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
In case that we leave due to malformed string, free the allocated memory before returning. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
If calloc fails, bail out immediately instead of trying to use the NULL pointer. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 08 Dec, 2018 1 commit
-
-
Wolfram Sang authored
I got a compile error with GCC7. When trimming white spaces from strings lsmmc uses strncpy with overlapping memory areas. This is not allowed. In addition, the implementation was not efficient with calling strlen and strncpy once per iteration. Refactor the code to be valid and more effective. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 17 Feb, 2018 1 commit
-
-
Uwe Kleine-König authored
This macro saves a few lines of code but is harder to read than the equivalent code spelled out. IMHO the latter is more important, so expand the macro everywhere and drop it. While touching this also unbreak the strings used there for better grepability. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
- 26 Feb, 2016 1 commit
-
-
Sebastian Rasmussen authored
The lsmmc tools contains an extensive parser of the CID, CSD, SCR registers from userspace. The utility works as-is and uses sysfs to read the register values. The original code is created by Sebastian Rasmussen and still lives in an attachment in the mail archive of linux-mmc. It need to be merged into mmc-utils repository, which is convenient for testing MMC device from userspace. Change since v3: - Remove the unused EXT_CSD parser in lsmmc.c file. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Chris Ball <chris@printf.net> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
-