From patchwork Mon Aug 17 15:15:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 247843 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2859020ilo; Mon, 17 Aug 2020 11:21:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznJDY+kP2t2PGEp7J3LR3r1W019FlUC+Beg7izROTvPLurJjmqP/Ymewjp47lKyaHEZBYc X-Received: by 2002:a17:906:a053:: with SMTP id bg19mr8048804ejb.444.1597688501835; Mon, 17 Aug 2020 11:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597688501; cv=none; d=google.com; s=arc-20160816; b=fCdacwjgoXVK/WIiGWMWJIV9nGd9oO3l8Icrm7QRUsTMv6aj7n6OKWqhfGXMhJ9uha 97lvbMUuaWCJplVM/J56F0Tt8A5z+wGPOOsEXbLqyN72oH7fYo3quFQA9dpVLC9XHPGw jbfHfJ3HmldRkb6lIAKO/xhBuU5w0+7oJCzrcZaZvdmhQmsO7S8gicVUZkG5jjQqKtfI n/uejocN1Bj5hEUpBKEoFLHof03bVKQuxn/cwaX4ygv1CbMe+pngA2tl36dNvkOGyryn 73zDU5JdJVH3YUtIscufwJRWeEdeXEmMVU9MB1+bUiyzvHV9kSiph1CpsQGDn1TwWoDV sMAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/pRJfLVDAj5iykssgpENgTanrOfh532v8czJfly0MzQ=; b=BIZnL/2rpTEI3W7n4cQS6bJUo8sN6UAociUov0+3jVYu7I4q0yb79MefMEj3xj4E4a ovLpubkW1Y0AQGJmZ+GsxRmnNq/mojKAQ2xsorV0+B4MNsRfvM9vdZH9d6Tl2xpwZXmH Zw4tAFsWWJnPAog9vrWzLRyOOjfEe2UbKZnUWP0+eyttTTfKFRYI/lO4eowd3+l3ps0t nLf2uTRcjQfKGUP1yU1PkfNNLqIeF6MMVk68hRzl7i8nWiYwzGYAa0d4RW70AFpoxSH6 uQIiwx2yKT+L2Iq7HppiwJOSHq9Pj5/JqwE4Ywykogmi+Erps1nPBoSGTefw7JQTEmPF HXdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZAny6X7o; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si10563894edz.371.2020.08.17.11.21.41; Mon, 17 Aug 2020 11:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZAny6X7o; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390894AbgHQSVk (ORCPT + 15 others); Mon, 17 Aug 2020 14:21:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:51602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388268AbgHQQDy (ORCPT ); Mon, 17 Aug 2020 12:03:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03BB920729; Mon, 17 Aug 2020 16:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680233; bh=n+4mjzhZOD0dhZ5FpubvJtXCZana5ujBHbrb6imTBqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAny6X7oYmoyWHia/YMff1gDK04OwHXY3PdyN1o27b6x4eG4gTF9KbNeQjm7JtYEB UgXgP5L2KbeGjHyb1EQt4YsU5eH7uPxKQHDAncTEkv5+J3K9IrNnLyspFbL3zkQdl7 V5sPbQ2lITmnXT/c0vua9Q14uHWVXTEtdlKbjb9E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Pavel Machek , Sasha Levin Subject: [PATCH 5.4 105/270] leds: lm355x: avoid enum conversion warning Date: Mon, 17 Aug 2020 17:15:06 +0200 Message-Id: <20200817143801.012141646@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 985b1f596f9ed56f42b8c2280005f943e1434c06 ] clang points out that doing arithmetic between diffent enums is usually a mistake: drivers/leds/leds-lm355x.c:167:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion] reg_val = pdata->pin_tx2 | pdata->ntc_pin; ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ drivers/leds/leds-lm355x.c:178:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion] reg_val = pdata->pin_tx2 | pdata->ntc_pin | pdata->pass_mode; ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ In this driver, it is intentional, so add a cast to hide the false-positive warning. It appears to be the only instance of this warning at the moment. Fixes: b98d13c72592 ("leds: Add new LED driver for lm355x chips") Signed-off-by: Arnd Bergmann Signed-off-by: Pavel Machek Signed-off-by: Sasha Levin --- drivers/leds/leds-lm355x.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/leds/leds-lm355x.c b/drivers/leds/leds-lm355x.c index a5abb499574b8..129f475aebf29 100644 --- a/drivers/leds/leds-lm355x.c +++ b/drivers/leds/leds-lm355x.c @@ -165,18 +165,19 @@ static int lm355x_chip_init(struct lm355x_chip_data *chip) /* input and output pins configuration */ switch (chip->type) { case CHIP_LM3554: - reg_val = pdata->pin_tx2 | pdata->ntc_pin; + reg_val = (u32)pdata->pin_tx2 | (u32)pdata->ntc_pin; ret = regmap_update_bits(chip->regmap, 0xE0, 0x28, reg_val); if (ret < 0) goto out; - reg_val = pdata->pass_mode; + reg_val = (u32)pdata->pass_mode; ret = regmap_update_bits(chip->regmap, 0xA0, 0x04, reg_val); if (ret < 0) goto out; break; case CHIP_LM3556: - reg_val = pdata->pin_tx2 | pdata->ntc_pin | pdata->pass_mode; + reg_val = (u32)pdata->pin_tx2 | (u32)pdata->ntc_pin | + (u32)pdata->pass_mode; ret = regmap_update_bits(chip->regmap, 0x0A, 0xC4, reg_val); if (ret < 0) goto out;