From patchwork Wed May 17 07:18:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 95088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp835561rwl; Wed, 17 May 2023 00:47:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JCrjH5c2AW206R+Mk0y2/KU5U6II2QqVdUcfZ7Pv4F5D1NEcYX3KnoQnjADgx0mzxxtvy X-Received: by 2002:a17:90b:506:b0:24d:ec9e:43d8 with SMTP id r6-20020a17090b050600b0024dec9e43d8mr38173642pjz.7.1684309670018; Wed, 17 May 2023 00:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684309670; cv=none; d=google.com; s=arc-20160816; b=ARJ0JLRmY4cNyAam59++JjyN0B6Vp2MnGaX8t2GZ6EERsdZdZ0fyLDYioa2h4ZYZbc a1tT1q32ThXIwcSLW8SG4IOBWEYvuqxuHHH1ENUUtIhLDnaY1KcSGkNYFBfbufCnWlxM LXW8lfUriEUs9K8slxfHxF/xZpPUC2ItjqXiiH9Fd5HotKnwVB6Xdxhjh92gD1kylM/1 5JKeQd7tDyMFIqaoOyEdXKXR11ERwXTLpkLEVeaYUUXX9vdKmRG6bJAirIjIVss94Bjw 9/5WhmMLQ0yaCJSVFREXy+3It/DGvFF22/uy63ntBk3kEOKNQX+u+mSt0uv5l2kFdVVm h1Dg== 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 :message-id:date:subject:cc:to:from; bh=ojH8JHW7gf454vGeC7W3uE4My3/HWzcV1GC/HN22Wvg=; b=vHwKi1hMjPO3CQlM+3dpn4u3osYunOxpD9a+0vJ5QWYYnA3MS9D8P9kuXvXlb6nGW5 zHw7J+qf0Z1rk33YmSXOCwDZ0PA1JC18P92dDNFXMVFnek9tbewvwresDaCk6UE4yNJt 4pDohXYVgYP0MXQTySlO6WbUGVCrLLAIjwTvibH6cgPl9YXdto5/An1Zb67EmgO8vCyr qEggP6xHHQ3M39EakctxVlWi6ClH2/EapVeqkCyvxFvqHspV9gKxvzXe2OWk40lh+B6U N8utCvPJWlouYO4+uHJvroCsXwdP/s//2VT/eUt6MRXgdQELU85lHtg8n5SHMGBgW0tb Gugw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a17090a8a8b00b0024e3527e8e9si1259673pjn.9.2023.05.17.00.47.33; Wed, 17 May 2023 00:47: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbjEQHSz (ORCPT + 99 others); Wed, 17 May 2023 03:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbjEQHSw (ORCPT ); Wed, 17 May 2023 03:18:52 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DDD5109; Wed, 17 May 2023 00:18:51 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 343BD8117; Wed, 17 May 2023 07:18:49 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Kevin Hilman , Nishanth Menon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dan Carpenter Subject: [PATCH] bus: ti-sysc: Fix dispc quirk masking bool variables Date: Wed, 17 May 2023 10:18:41 +0300 Message-Id: <20230517071841.58444-1-tony@atomide.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766126696704488039?= X-GMAIL-MSGID: =?utf-8?q?1766126696704488039?= Fix warning drivers/bus/ti-sysc.c:1806 sysc_quirk_dispc() warn: masking a bool. While at it let's add a comment for what were doing to make the code a bit easier to follow. Fixes: 7324a7a0d5e2 ("bus: ti-sysc: Implement display subsystem reset quirk") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-omap/a8ec8a68-9c2c-4076-bf47-09fccce7659f@kili.mountain/ Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1791,7 +1791,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, if (!ddata->module_va) return -EIO; - /* DISP_CONTROL */ + /* DISP_CONTROL, shut down lcd and digit on disable if enabled */ val = sysc_read(ddata, dispc_offset + 0x40); lcd_en = val & lcd_en_mask; digit_en = val & digit_en_mask; @@ -1803,7 +1803,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset, else irq_mask |= BIT(2) | BIT(3); /* EVSYNC bits */ } - if (disable & (lcd_en | digit_en)) + if (disable && (lcd_en || digit_en)) sysc_write(ddata, dispc_offset + 0x40, val & ~(lcd_en_mask | digit_en_mask));