From patchwork Mon Aug 17 15:12:01 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: 247872 Delivered-To: patch@linaro.org Received: by 2002:a54:3b12:0:0:0:0:0 with SMTP id j18csp2594127ect; Mon, 17 Aug 2020 12:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym+rS/CIw+yWOTyizdg+mHRcJ/Rvv4M4hV6lKn2vnVn6AgEOVlM2JL3+2lUVdsC0QHjkC1 X-Received: by 2002:a05:6402:13d4:: with SMTP id a20mr16850692edx.161.1597693214097; Mon, 17 Aug 2020 12:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597693214; cv=none; d=google.com; s=arc-20160816; b=pHsrZW79LCrMFVtZQnifPC0fK6nFC5LwHtny8DWw0I7MnzPsxDVy6gZra8I9aMCiQR qQRVauJZfs9PS57GmyfirKqEVJgok05noe63HqNU7r5tCE4JPPQaFgW9zYzI0dfByah8 7BmsgeQBPl61cdv2MX3qgolluV5H+8vYP9S1ZUzAkEt08lQR3YJxC7eNizh5Kg5LBqZx 2MP8+dXN/blZ/5wBJQI2SYO0nGfqV/A6OMeqJfJ7O52spfTIEzbdWYnqWp7kSWrAeS52 eqVb2gmDh9OLy3Bdk9audmAt+2R3F2B9b8R6aa/fXnwmy74glSsMznB1uXDdJ+vC5QMW bHTw== 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=efNNB+1BK7F7fAguRtYwr8h/aKpqSr1H2UwMM6WoorE=; b=U1DbbS1X3opqBGpFGmP7w92hLeloCxbaifovL2l8ApxxQwihbRQUtcYyLBz1r+TwE2 PL3HxCRDpcRF00w0IiqSkENrM6Fc7JlNWBRlwkka2XBx7vkm4f9zSlKnj9w/jrRBHijs DsEiZblUgjjWjdy8XNrRr/uLe5KmttlBiEHflL4WJnYbNFVeiTvzF9ifwUq4gdq/BL/k ppM1CW6rwXnsH+eNge5YUF4m8ZJqGpGbxs2+MWIBt0Mm4Z8R6AwfrTOG1V3Drue6OJ2u bqH0GoR6MGlA5d72zGKzOnbYTnIR8v/C1qDfd6yGSntEXi/CmVKDmfa/P9yTsSr7GkUM CcXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nXjYdXHo; 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 a5si11826335ejb.582.2020.08.17.12.40.13; Mon, 17 Aug 2020 12:40:14 -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=nXjYdXHo; 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 S1732539AbgHQTkN (ORCPT + 15 others); Mon, 17 Aug 2020 15:40:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:32968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729768AbgHQPZx (ORCPT ); Mon, 17 Aug 2020 11:25:53 -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 81AC1205CB; Mon, 17 Aug 2020 15:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677953; bh=9tU5YFD76bVfGvbZRgLUI4JCisB5S13EcVehNhmKP9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXjYdXHo9CeXKExJ4jGhwcg0LNR0hUniPMmVAMGaBUEhjsvzMg9OlfuDOeZR33L+U O3SCpxPbMSQG1D8AYlsLtXEBjd98yXXxEbsVk1hUJJrtyOjlIUZY49tFRBUBiA1lR+ ecNs6l9f72JSq72/WgFy/yNUP+5Ntv//p4ttNdLE= 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.8 168/464] leds: lm355x: avoid enum conversion warning Date: Mon, 17 Aug 2020 17:12:01 +0200 Message-Id: <20200817143841.865037175@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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 11ce052497514..b2eb2e1e9c04b 100644 --- a/drivers/leds/leds-lm355x.c +++ b/drivers/leds/leds-lm355x.c @@ -164,18 +164,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;