From patchwork Mon Aug 17 15:13:19 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: 247858 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2885988ilo; Mon, 17 Aug 2020 12:01:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSc7tNDzt1qidKLHRVqnydrmCNeoC/KjmgfSwKDJb7GHaxeY1r96BjK7p1TJ9TLka8f8X9 X-Received: by 2002:a17:906:7492:: with SMTP id e18mr16454238ejl.375.1597690908380; Mon, 17 Aug 2020 12:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597690908; cv=none; d=google.com; s=arc-20160816; b=K9+O675TOhI5rAHxUnoJUiAL9+JPev7H31B57yFvXzBJ5DKDwnliguFU4U9TqB3qoc BATMiE9FpUm/GHRv4FLCxzt4L8DxukY3O1w2yLRXU1ENqo2/MwaIByMiuLoLmNnNyYr8 7MSba+jB3LYx3Lk6xfxuMLIHQf9Xebtkp7V/uU6MLjDAC6POBce5KNT9k0wmGkvCYfo8 WGh3Yai2MgtewQfD0v6c3xVbpox//BbCyEwFfT9pxwfeWp2rFy9MZyiRTxjmvFArCK0g Hhi7I1yLL9y6MG8nA+GJopEv7/KwP9YZ3fmS3k7b1zyl3VlpmYgSJ9Ji+7Pgb+wSmRcA kstw== 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=cTjio3ZWGUaSupAxj6pEbqCgjKU316/T+rc58WzgnJXOg29HRXK4Gfm/VFwMTUk+UQ lRiurOw1Of2SKEH//CmieS88G5bHOVMNbJJxfF4CiHCjUx3FtTnkV9JXjzSG4ZgfsPG0 FFdaWBkYlUfGDswz67+IWi7GI+1U+XEhB+0UUH54HepdMg0g84zre6wCBEsI3WU+d9PW e1dGN7vZkOCMnWpXJdm9W23W6QxvqV3rRoBkiFzJqFI7EuG6QLjVqzg7icCjOlBQt3W9 WpiWnEHshh6GPAtrOlAETWxrUvPOC3arsVwRa3nL0fnkwGuq9DWF3/kEhDhXAWKJotRr yZrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="tq/bEPg6"; 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 dm1si13252141edb.315.2020.08.17.12.01.48; Mon, 17 Aug 2020 12:01:48 -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="tq/bEPg6"; 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 S1731773AbgHQTBc (ORCPT + 15 others); Mon, 17 Aug 2020 15:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:59716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730212AbgHQPri (ORCPT ); Mon, 17 Aug 2020 11:47:38 -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 0FEFE2075B; Mon, 17 Aug 2020 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679257; bh=n+4mjzhZOD0dhZ5FpubvJtXCZana5ujBHbrb6imTBqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tq/bEPg6X9S19ckrTFjl298NX5fqwv+0u9aPtOKZs4OAnuG0Kl/pAREE/kFkqUEnW pS1ORR3Cy29y72pogZkTTw6HpefyYUG7IjbSsiqSrxiPrchFCOpRNLhkMIhSpxYAeO V93m7HDl9mxNBpBIHo1bpZSBQ/9jt+/2GQl+4TfE= 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.7 149/393] leds: lm355x: avoid enum conversion warning Date: Mon, 17 Aug 2020 17:13:19 +0200 Message-Id: <20200817143826.841853150@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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;