libsdhcdrivers: Improve read/write arg evaluation Transfer command's argument is now evaluated with a help of ternary operator so that it can be marked as const, and logic is more compact.
diff --git a/libsdhcdrivers/src/mmc.c b/libsdhcdrivers/src/mmc.c index b8b8f41..df7e849 100644 --- a/libsdhcdrivers/src/mmc.c +++ b/libsdhcdrivers/src/mmc.c
@@ -435,16 +435,11 @@ uint32_t command) { struct mmc_cmd *cmd; - uint32_t arg; int bs; bs = mmc_block_size(mmc_card); /* Determine command argument */ - if (mmc_card->high_capacity) { - arg = start; - } else { - arg = start * bs; - } + const uint32_t arg = (mmc_card->high_capacity) ? start : (start * bs); /* Allocate command structure *