Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6806067rwi; Mon, 24 Oct 2022 06:23:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lGLtIL7ovK7sA+x4nFv1jOBAa2RPYZfSYm+UZ6QFDdmMJXGgSmGd+6yXXCoBiMZp1QH4Y X-Received: by 2002:a05:6402:4303:b0:45c:cd3d:f5 with SMTP id m3-20020a056402430300b0045ccd3d00f5mr30582775edc.188.1666617828988; Mon, 24 Oct 2022 06:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617828; cv=none; d=google.com; s=arc-20160816; b=lCncs5IdP3p8qeRHjKYDcwK2Wb4HLzmPBHvuoIShQwY9yZdvYrGS2bSwUIcm29Dj1s 9HA5qGixElWt6HTyqD45OsApbwEVZvGYiVQc6IHEK/E7+72nUowqFP0fo71XD7Q5nqa5 i6IkLLCbbtPfiXvtixtWSKawDjQbbcaqLY1o1bqvmBFpeSLtegGL/bwfLUd67zPK3gUQ sDat7KGu0aANulRAPSoAkAukDswSFnOcpBiedyQmG5ttmUmejxQHs4qEjsKxeIGAT2YH nCK+xQAh/Kozr3/0RsFXWX35GB2EiIo6n+jSoZel3Sf4mryAZcGwwbjkiGSpQ379elDG IdPQ== 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=W5TlCFZqPFVZMvd7vZxFCTmLiY4J76n86xvQCe2pJEo=; b=CzJz18Be9JUQQJojvHJuowLuuN7o93GfR7FNpRiWCY826UjJproqacyHGPUYLibXjb gHoe0AVRdyY86WdkrYc3wY/TGHmyj3IdHo5r6fxuCS7MussLtU8kgHeQSWZjiH6vS9aM oPJ2uE0IwRg1RLnMo368+N4boga7q3Vw+KbBge8Djj/0npHREDc52jIOFhfkDZj/bU9A Mkzti3GgQHAhtHhLHuxhI01aTmC6Fw4349x4aHHiKI3EFns5scAEGmM0zHKroCo9VXqb dQBu8AnIMiv4hj/4QGN5SOT7gNr2bWJ8PutBrrBKeqP8xxm57RSYhmF1w1b5b3kMMT51 Cyhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BbcjQWI7; 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 jg36-20020a170907972400b007a00aaf659csi7306029ejc.198.2022.10.24.06.23.24; Mon, 24 Oct 2022 06:23:48 -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=BbcjQWI7; 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 S232786AbiJXMII (ORCPT + 99 others); Mon, 24 Oct 2022 08:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbiJXMFa (ORCPT ); Mon, 24 Oct 2022 08:05:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB627D780; Mon, 24 Oct 2022 04:51:35 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 9014E612BB; Mon, 24 Oct 2022 11:51:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A54F5C433D6; Mon, 24 Oct 2022 11:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612287; bh=8veHvggDsF0H695N4ZaRHLld1XJTkiSOIyJfY6Uu+i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BbcjQWI7IiQj4m55vOPeE3ZFPsHEB5jYgXE8JWdmD6v7ssDUu63kmo+K3KZT9J9Ti +4CHlDxL6/mAnBLm8Vwy4sOB7BCzcglTNmDHHkyyTN6Dp+kO8BxZP/mF5Q8eS5AGUw XYLqVRdcbFbovmF27OXbM3iye/NciAJdKl8aQpKs= 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.14 099/210] platform/x86: msi-laptop: Fix old-ec check for backlight registering Date: Mon, 24 Oct 2022 13:30:16 +0200 Message-Id: <20221024113000.237096348@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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 d5bfcc602090..7279390a2d54 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c @@ -1061,8 +1061,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