Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6740567rwi; Mon, 24 Oct 2022 05:38:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4geplD4M6BCV8nRLstuqlyziac/LCo6G7P1fW2R6lw4wAmWfkqy7SNlRysjRmROtBo8DIk X-Received: by 2002:a62:1d52:0:b0:56b:f472:55e7 with SMTP id d79-20020a621d52000000b0056bf47255e7mr2248516pfd.63.1666615130994; Mon, 24 Oct 2022 05:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615130; cv=none; d=google.com; s=arc-20160816; b=KQkuGBnjclQb7iglE6Nms+Wa5AgCwijKfgbTJ5KCjwbgSYnqTJM+ZtIu7xh0mgWpqc OSD01P/AueoydJMtpIxsbmv1EzWnLhsbSOb8AcETqI7JLie959/nNzPJFVD/ZQGVmcxs dEp9tESjaRT83O4eUdtyaVJj2Aun8TDpoOCYckcqDmEuX7pbusMTqS67VZWup8VfaSiQ +c0E8An1Clp7IhAwn36RB/zm8jlhFK0EIMBQ9g2ZfWy0ghz0eSSLRfOAvpBcV50hVvFf TJ/JnxPZ00OLNCfdsofbqfXlfY0sx+isaCLD1kAMvb7VzO7nIR6OIvmTbnDQPZZYj9aw t8AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aOlNTta+M3HaDSe13gsWYSv6zoc9lJohil0oIgqayCI=; b=a6kBAEYVVx2zhWuzHiC8Ipbi6wHc4rGmK8qIqjZNOU8xr6NbGKRjGKVws2h0gQuWiq TYL5zezi10ML5IlOCU/mXF3ZIpAbQ+EDsb3PV8Kk7bPpB64gIOzLFPie2lS3A9Q7OPxZ H3EmCWVj2rmWrd8QeZAJYFXddmxug2diQ4Du3znbswWElvbvpM0+D/TvxOSZGAdJIw5g rH1utlnKCiK7+FybkFnxbrJcmCw6MqopiPwCUYEltboHiy6JcGlDK+oEooECpYbAyy3M qBeERgBe/znG/1KPWpcM1exC7OlVuCmdnUISik9FqKwy1aDF5HZeKlslg9ge3LBua6IX kLfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yO7jJeJl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a056a0022c700b00537e88da121si37131715pfj.35.2022.10.24.05.38.38; Mon, 24 Oct 2022 05:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yO7jJeJl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231217AbiJXLq7 (ORCPT + 99 others); Mon, 24 Oct 2022 07:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbiJXLoz (ORCPT ); Mon, 24 Oct 2022 07:44:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17C9E3B1; Mon, 24 Oct 2022 04:42:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89DCDB81134; Mon, 24 Oct 2022 11:41:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E407BC433D6; Mon, 24 Oct 2022 11:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611705; bh=qazdIVwjniIPBxsCL1PrgzDj+HxpC6llmoILXcDM3WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yO7jJeJlxdhIfVkS4hfXm3wKkSn1KnV4gT4aYhyloAd3kvFcoawNcHBC1kZT8Kx9j 7GNK4OkREIvBPDebsgtxrHvBxOr/AwvJA2B+PRVmQbB9Batf0Vu5dcZ8dkgTC6Nlcw HVoOYDaTdfRr2nBUSy66rFREQSATFgSvpADvFyGg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Sasha Levin Subject: [PATCH 4.9 078/159] platform/x86: msi-laptop: Fix old-ec check for backlight registering Date: Mon, 24 Oct 2022 13:30:32 +0200 Message-Id: <20221024112952.291810297@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 83ac7a1c2ed5f17caa07cbbc84bad3c05dc3bf22 ] Commit 2cc6c717799f ("msi-laptop: Port to new backlight interface selection API") replaced this check: if (!quirks->old_ec_model || acpi_video_backlight_support()) pr_info("Brightness ignored, ..."); else do_register(); With: if (quirks->old_ec_model || acpi_video_get_backlight_type() == acpi_backlight_vendor) do_register(); But since the do_register() part was part of the else branch, the entire condition should be inverted. So not only the 2 statements on either side of the || should be inverted, but the || itself should be replaced with a &&. In practice this has likely not been an issue because the new-ec models (old_ec_model==false) likely all support ACPI video backlight control, making acpi_video_get_backlight_type() return acpi_backlight_video turning the second part of the || also false when old_ec_model == false. Fixes: 2cc6c717799f ("msi-laptop: Port to new backlight interface selection API") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220825141336.208597-1-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/msi-laptop.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index 42317704629d..c2a1bc8e9fef 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c @@ -1069,8 +1069,7 @@ static int __init msi_init(void) return -EINVAL; /* Register backlight stuff */ - - if (quirks->old_ec_model || + if (quirks->old_ec_model && acpi_video_get_backlight_type() == acpi_backlight_vendor) { struct backlight_properties props; memset(&props, 0, sizeof(struct backlight_properties)); -- 2.35.1