[PATCH v2] power: supply: macsmc: Support macOS 27 SMC firmware

Sasha Finkelstein k at chaosmail.tech
Fri Jun 12 12:42:12 PDT 2026


> On Jun 12, 2026, at 21:33, Janne Grunau <j at jannau.net> wrote:
> 
> I think the following is slightly easier to read
> 
> {
> if (power->bcf0_1byte) {
> u8 tval = 0;
> int ret = apple_smc_read_u8(power->smc, SMC_KEY(BCF0), &tval);
> *val = tval;
> return ret;
> }
> 
> return apple_smc_read_u32(power->smc, SMC_KEY(BCF0), val);
> }

I personally prefer using early returns as much as possible, as it makes
it easier for me to read in linear order and due to line length reasons.
But no strong opinion either way.





More information about the linux-arm-kernel mailing list