From patchwork Thu Aug 20 09:21:02 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: 248015 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1213805ils; Thu, 20 Aug 2020 03:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLswIxHpoSyMdrr5lGwouhpmgQZ0/YkSxdxlt9dF5jZ2KNhoDxQzMtpL0frMp5+rr6gAOi X-Received: by 2002:a17:906:68da:: with SMTP id y26mr2435326ejr.250.1597918265085; Thu, 20 Aug 2020 03:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597918265; cv=none; d=google.com; s=arc-20160816; b=LdB75wakeOZz2IaowggLD+K61Ri173uK7rt2SVmLU24D46dm0Wj5NjkjBHMqhG6wKf n+oKa4NntHBy3BmIXeFR42JItAAzXxMPRdnuxCBvyquy3hNV0+L0yDtGCUocRS8UsrnY EiC94h+RjfG0oA7752LBkXNnHrWQuswZezyrYQvramQ2BcUplxYO6YOuqqWszGG8Fr7K gJ8uc0HTnxbrN3ygrPv30zpLC5kvlp6WtV2nHJKazeFUD6ndftNMYQR457rMdB5gFq7J IgryZF11l8ZPtcgBtowKzri1hb07v7/oG2uXs+BgfdozFDrkbJ4MHsYdksLMidJCMZRz OCiQ== 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=CsxtFe9OmY9q3oqoK+6JGGqYpQMg0iXZX3x/esM9488=; b=Z1nUnR7KaLN8YWeMjYHlwqzluxxqeZ8LTCyojBfGGBYFRzwxXpwH9rGK8epZVtA7XF tvRLw0gT/KlStWshCYDgYztYgR7lSRPshLYKRNif+imgZtSajatsdZgPdbpyrk6/3Y5v IGvrXeHKxZjpa7sZmaWnTHHdSYK/opHnH7mNVlh9nZi4Qi5UtGdRCNR6A77W20FeTxVS mMJsWbWIEHgKKmkCB/Ab2kyIRdO6VH9cDbPhbtrw79VqLRDSpAQj4o2jA1Z1aexPWrvo UDvtbtcw5umu5voG41yvIV+WKl+Y2P4xsC8LTsn9s/zlvs1vsnZbgBV7Uiv0fqZM0aJ3 RxEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZLoFDvTq; 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 w9si1057634edq.487.2020.08.20.03.11.04; Thu, 20 Aug 2020 03:11:05 -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=ZLoFDvTq; 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 S1730924AbgHTKK7 (ORCPT + 15 others); Thu, 20 Aug 2020 06:10:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:48270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728509AbgHTKKv (ORCPT ); Thu, 20 Aug 2020 06:10:51 -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 489C0206DA; Thu, 20 Aug 2020 10:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918250; bh=deAXlMAOnKUuC4bREE4TaknAbxR6vkBJLpB4dFrHtk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLoFDvTqbGYSxDLg5aS+I0TsywmKFFiV5Nq8SzCLn2af+ziAVy7FWHEBFAdNeXNBh kqoYIJq4pIonYZTnzcFkV1wsXr1lAzDmMxtlQ4MuiQmKnfzHoZ3RinRHcUvnTO27zL AG0oVGA2HWgx3hssHgehh4IFV720C8QP5sNqaTyg= 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 4.14 087/228] leds: lm355x: avoid enum conversion warning Date: Thu, 20 Aug 2020 11:21:02 +0200 Message-Id: <20200820091611.964472782@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091607.532711107@linuxfoundation.org> References: <20200820091607.532711107@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 6cb94f9a2f3f3..b9c60dd2b1327 100644 --- a/drivers/leds/leds-lm355x.c +++ b/drivers/leds/leds-lm355x.c @@ -168,18 +168,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;