Skip to contentSkip to conversation

lib/vsprintf: replace min_t/max_t with min/max

PATCH Alexey Dobriyan 1 participant 1 message Jun 2

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 8 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
 	if (spec.field_width > 0)
-		len = min_t(int, spec.field_width, 64);
+		len = min(spec.field_width, 64);

Honestly, I do not see any big advantage in replacing the macros. In fact, the min()/max() macros are even more complex because they check compatibility of the compared types.

Quoted 6 lines
Quoted 2 lines

IMHO, this adds non-necessary churn into the git history without an obvious advantage.

The advantage I see is to give a good example to others to avoid min_t() whenever is possible. I am not insisting to include this patch, just share my 2 cents.

Patch is good. "field_width" was bitfield for a long time, so min/max couldn't be used.

%alexey