From patchwork Sat Sep 15 05:25:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10601397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0B3413AD for ; Sat, 15 Sep 2018 05:25:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06F12B5F7 for ; Sat, 15 Sep 2018 05:25:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2C752B611; Sat, 15 Sep 2018 05:25:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BE7A2B5F7 for ; Sat, 15 Sep 2018 05:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbeIOKnM (ORCPT ); Sat, 15 Sep 2018 06:43:12 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51257 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbeIOKnM (ORCPT ); Sat, 15 Sep 2018 06:43:12 -0400 Received: by mail-wm1-f65.google.com with SMTP id y2-v6so3978022wma.1; Fri, 14 Sep 2018 22:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=O7jOysXB3AWG7qkSJvbO/cQomiQ0kilMR9/2eTU9sw0=; b=JU2UTybVUIdjgCxtnkFiGT2T8AnvEgu3ghtxgmxbsSz9Tph1BcR1lb7n+9Z2wZPq7I Uu86IkUN/8p9vi1XtYjlLbFqtkqh571AAWGaYUphFLRTAvOziU1oZw8Vdg2HMIocc+BN RmdyujqzSI+awj9uS5Tkay368WkQxvc3y7IVbDoT1t1nFbEnywchwpTxxve5yGhxkY4d CDQW7edLKGI1eHLGgXSGjf7aUyzUgUG3DKbuv+gKlUvM9IUHsg8rQAeae7a2+Be/BX1D BkyYQj+tQ/itavO0yFfm8CnmsVDQsfjqVJFpQKBfonw89trNs4RxsEYRlRmpVWWsGrGm 1w8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=O7jOysXB3AWG7qkSJvbO/cQomiQ0kilMR9/2eTU9sw0=; b=gYairWI+GjFmRYkrs7CvGgZ6hT1pjgeDVODz1DJK/aJ2Il42HoR0VlIxlHSSrOU3wd mn0nTUakKN64aff9WVrIc5b4ITX1w3h8ipD+6iRMYFZPAIlttjTIiKwhJSDN09QoZRBX a/RIlGLuAOWHqBOmD7hZHYp7wd8jzVaheyhlLSgFvhADQAqP3IGaOUDmKGFKWlNbFCGJ IRVV+06oPbLzCdsV5i6ciEC+WtYSD5gTCL90qagz2CgNJ9CTAnlMhZB8qQ3syCEmBiJy A6RvJsLDlSXwYUiKmpxkBVugMgTCMkiEY0p9d19lCRNeiuPpLQE9/Th9ebWLgTAPv8XS mXlw== X-Gm-Message-State: APzg51D9EHxzQq9yQyGQx+rmvIXeZTYwBUWbWSNirh0o+0JAk7eGXE6j i2jG9mt5QeH/sZ183dKcPM0= X-Google-Smtp-Source: ANB0VdaJcNXABTZDIoC83mQtTDJE54cbkTRSGfKxkWA6aC8wLxV2w+VU8vmGSXhlrKRwNlXk9KFoLQ== X-Received: by 2002:a1c:d785:: with SMTP id o127-v6mr4323783wmg.67.1536989130016; Fri, 14 Sep 2018 22:25:30 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id 142-v6sm804829wme.35.2018.09.14.22.25.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 22:25:29 -0700 (PDT) From: Nathan Chancellor To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH] iio: adc: max9611: Avoid implicit enum conversion warning Date: Fri, 14 Sep 2018 22:25:11 -0700 Message-Id: <20180915052511.2243-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns when an enumerated type is implicitly converted to another. drivers/iio/adc/max9611.c:292:16: warning: implicit conversion from enumeration type 'enum max9611_conf_ids' to different enumeration type 'enum max9611_csa_gain' [-Wenum-conversion] *csa_gain = gain_selectors[i]; ~ ^~~~~~~~~~~~~~~~~ 1 warning generated. Change the type of the variable 'gain_selectors' to int so that Clang understands this is expected behavior. Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- drivers/iio/adc/max9611.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index 0538ff8c4ac1..3c358b16a8fa 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c @@ -275,7 +275,7 @@ static int max9611_read_csa_voltage(struct max9611_dev *max9611, u16 *adc_raw, enum max9611_csa_gain *csa_gain) { - enum max9611_conf_ids gain_selectors[] = { + int gain_selectors[] = { CONF_SENSE_1x, CONF_SENSE_4x, CONF_SENSE_8x