lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aB39iJm9759RYAKW@blossom>
Date: Fri, 9 May 2025 09:05:12 -0400
From: Alyssa Rosenzweig <alyssa@...enzweig.io>
To: sven@...npeter.dev
Cc: Janne Grunau <j@...nau.net>, Neal Gompa <neal@...pa.dev>,
	Hector Martin <marcan@...can.st>,
	Linus Walleij <linus.walleij@...aro.org>,
	Bartosz Golaszewski <brgl@...ev.pl>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Sebastian Reichel <sre@...nel.org>, Lee Jones <lee@...nel.org>,
	Marc Zyngier <maz@...nel.org>,
	"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
	asahi@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
	linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v4 6/9] power: reset: macsmc-reboot: Add driver for
 rebooting via Apple SMC

> +	for (i = 0; i < ARRAY_SIZE(ac_power_mode_map); i++)
> +		if (mode == ac_power_mode_map[i])
> +			len += scnprintf(buf+len, PAGE_SIZE-len,
> +					 "[%s] ", ac_power_modes[i]);
> +		else
> +			len += scnprintf(buf+len, PAGE_SIZE-len,
> +					 "%s ", ac_power_modes[i]);

Nit: { braces } at least on the for loop...

(And might be more concise as

    for (i = 0; i < ARRAY_SIZE(ac_power_mode_map); i++) {
        bool match = (mode == ac_power_mode_map[i]);
        len += scnprintf(buf+len, PAGE_SIZE-len,
                 match ? "[%s] " : "%s ", ac_power_modes[i]);
    }

though IDK how people feel about it.)

> +		mdelay(100);
> +		WARN_ON(1);

...What?

> +	if (ret)
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to register power-off handler\n");
> +
> +
> +	ret = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART_PREPARE,
> +					    SYS_OFF_PRIO_HIGH, macsmc_prepare_atomic, reboot);

Nit: squash double blank-line

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ