From patchwork Thu Aug 20 09:21:25 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: 248012 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1206964ils; Thu, 20 Aug 2020 03:01:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww4ova566rcm1DLnRtiER9WSuB/ORN/5Yqz2j8dRbvavojBlYfz5KA2ZfR1AWin4VpH4Rf X-Received: by 2002:a05:6402:2212:: with SMTP id cq18mr2159789edb.34.1597917694231; Thu, 20 Aug 2020 03:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597917694; cv=none; d=google.com; s=arc-20160816; b=leuLdyr5zcozXWLnqzJlcOe/pfRS7x65TGQWji8U3w7Pf2La/D3MnSJbuZwRnDRdjo t4lSIcejKRiTV6D2frVEJjpyEfM/PdsSqvYo2jXLr4wLJ4SurqGZe5PAlITj5kCXSjmk K9GlDlQcWbUyQYtyw2v0amk0RI9CIg21rihhJuOdhcNkJIPuO4Ae+6AtIjlbLyGmCraz oc8rIrJGtaN1EPOCsc3WRvpy840jAJ2rrMuvbEnRUYkbbqr9KBnnQa0mwmEJaGvJ1nVi i0hLjTDw10hXtP5TM+SpF+jF0fMrEFxIM1iutqTHUDgC4ubT3o/qExBJ0UQOTWmsB05K 8Grg== 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=a0qqnGwKaV5x93rr6Z7cLmmNwcXYqRfM+ZTMXaRf7ln4J+V88CGhqu0eryFJdvNV7X VLKwqM1BLp042O52iyleHwJIRDFfcm6RzKZqR0WNNz8L5Ma7M/TSrOP7YeEqmig4EOcp x1hHxdIMRLq0Oek9XUFTGmA437i/LeXmZ2HA+Kj6R5Disf+7bezHRbkjiRoKpFEEStH0 Z9aaC67frvvlVEUgJKZGqaInd+sulz8P6sqsv/rQt+pZncSdHCQqpanPuOJ5N1pglL0i 6siMyO2qXkW4v5SJTJ8qVaGQVokfEHDwB5aQEt0uRXXsV9zhBKWVVLiqwsannt7l1Rfb w60g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lz8CVpM0; 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 n16si885267ejj.284.2020.08.20.03.01.34; Thu, 20 Aug 2020 03:01:34 -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=lz8CVpM0; 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 S1728116AbgHTKBa (ORCPT + 15 others); Thu, 20 Aug 2020 06:01:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:50034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730406AbgHTKBO (ORCPT ); Thu, 20 Aug 2020 06:01:14 -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 6E09020855; Thu, 20 Aug 2020 10:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917661; bh=deAXlMAOnKUuC4bREE4TaknAbxR6vkBJLpB4dFrHtk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lz8CVpM0GxcUOB2yh6MuGG4Yi7Jzra68fMjevFaFlbKSU8NWT5SY7gJ6Kk1TvFpKA meiNhkGp+fSl4CADNe9a6+yokL1vPEeMOwQRNtCVLg44Ps7aNjEqZKVSVYR7HiPZBT 3conOIHEKlY9Q82FVRzIbH8z3IKwxp0Khyg4lsAI= 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.9 112/212] leds: lm355x: avoid enum conversion warning Date: Thu, 20 Aug 2020 11:21:25 +0200 Message-Id: <20200820091608.000191831@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@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;