From patchwork Wed Oct 25 11:57:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13436047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E738C0032E for ; Wed, 25 Oct 2023 11:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4X9QhE2G7rtFGcsP0YHLORT9u9WicwAKkXmXOfApGAM=; b=qK+tXrGXi3DkEq LZFpWamkVqoXd8SJ0rsANlO5q/rYVBdqmQMZXxJiGy2d+rNfHCtJ1u7q0OYFQiDAPDW2yanbWpg+f XhFUyy42Ibbq4Hrh/ta6/Pppwmr+pEoM9BCfzv4/l/iozxgOxBnXqEdmmpmcKz5HR7UDUIE1jY7tI 8cgJQSV/w6NiOWWIyB9gGzDLSCl6Cyk0M5xzPJ1w/BlocsBuaiMPCwv1LYJpcVQL4FALTBcr+bNlN 7DD8YGX0lxpRgaZUVSqVNM5TQSBwwwFadQADsSqsKGdruGQloCkjQSr6Augn+FGJPoo8GZyEYf9y4 YmyM7CIAlogK9pWeZ00g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvcWC-00CFTN-0u; Wed, 25 Oct 2023 11:57:48 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvcW9-00CFSZ-0p for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 11:57:46 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40806e40fccso40672675e9.2 for ; Wed, 25 Oct 2023 04:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698235061; x=1698839861; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=j6uVxf5kYe92K+O00MCE5FtASY43IgluJLHruF2586U=; b=VPjMyowjoiWqbMXY6+OqFbpBECsOOHsYfBN/goGvJdPNeqbiOLSE05SaSHaG2KQTnf Lq5mXU6NM2ASc4EYbv5hUVD3wi8ZOD6ru6tZRpJcAV2+xxN6GQM5WBFRKo1hLKtY6Y0C CrL24dkAZVrQVHGMdk45H8AoqOD7x0j8rvfGtGb77vYNgSS60Zq/wJoxtiFHSIx2XYpv aNmQIGqcVMgc7o3GXJG5Vh5Ioy0LKqLQU76TOBkFvkXDGtzbzERYw8+4m8s0+ghLMfvg oPebSq0qMvwKTR+5tnabzKXcuiC7RU6drHSlQX5FPmY/ZX+X2b5trz1traYgypKWLWFT pJgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698235061; x=1698839861; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j6uVxf5kYe92K+O00MCE5FtASY43IgluJLHruF2586U=; b=iYl+X7rrudpaPfwC6VfknSCPoM+4qTp/WbaOUCcTPkIrLK04lde1hN9w6LwsswoaGj q5uGBYrfEPHzdrBoshNB06r7lOkZMfRutxA3rdQlZdQcDszjtMdrcMnXmIaLXeXvlwdz PIlKDVNkafr9rOJ8xa+XUWzWQkpFdx2p05PCpgYpTTj2EbCZmPiAACe8Ny312uCHFCHl z689M0ksusacMinjFHcdrnVUc/Yd1pIvXRrw0q0w/pTZU9TUK05LXywfka/KT1423fWJ O8yjCIvWIAXv46diUQKWR8DQqTOSjWHS5+ETFSzYOhOq0zQq2MF96xxjfp4Mn7P/Iucs TOBA== X-Gm-Message-State: AOJu0YwJmd2jb8Y50QPjR5Gx7eQbRF294+qlJObpuBeAnES6eh9Y3jWd mN3expa5PDJ7hld97lIj7ub/LQ== X-Google-Smtp-Source: AGHT+IFlcuVvisAHY6IpOp9uDQk7RA7FjTqkZ2XNTiaE5hdwCeCI/PV48ajajNqa8VjggLSkT9Do7A== X-Received: by 2002:a05:600c:3b20:b0:405:4f78:e128 with SMTP id m32-20020a05600c3b2000b004054f78e128mr12172686wms.4.1698235061312; Wed, 25 Oct 2023 04:57:41 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id p30-20020a05600c1d9e00b003fefaf299b6sm14317313wms.38.2023.10.25.04.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:57:41 -0700 (PDT) Date: Wed, 25 Oct 2023 14:57:34 +0300 From: Dan Carpenter To: Uwe =?iso-8859-1?q?Kleine-K=F6nig?= Cc: Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pwm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v2 1/2] pwm: samsung: Fix a bit test in pwm_samsung_resume() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_045745_297985_30C78E58 X-CRM114-Status: GOOD ( 15.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The PWMF_REQUESTED enum is supposed to be used with test_bit() and not used as in a bitwise AND. In this specific code the flag will never be set so the function is effectively a no-op. Fixes: e3fe982b2e4e ("pwm: samsung: Put per-channel data into driver data") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König --- v2: Split the patch into two parts drivers/pwm/pwm-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index 568491ed6829..69d9f4577b34 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -631,7 +631,7 @@ static int pwm_samsung_resume(struct device *dev) struct pwm_device *pwm = &chip->pwms[i]; struct samsung_pwm_channel *chan = &our_chip->channel[i]; - if (!(pwm->flags & PWMF_REQUESTED)) + if (!test_bit(PWMF_REQUESTED, &pwm->flags)) continue; if (our_chip->variant.output_mask & BIT(i))