Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3028380imm; Sun, 16 Sep 2018 08:15:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZchzi4qQNEmhCWr0H4bYP2Tb3DQ3lQ/sTOCOps4FMDI5E0MchWqhy2yHFoDHXzpP3TRytx X-Received: by 2002:a62:9b46:: with SMTP id r67-v6mr21856167pfd.105.1537110939492; Sun, 16 Sep 2018 08:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537110939; cv=none; d=google.com; s=arc-20160816; b=gsEK3ioYVuMN2eoM9Y43cY9uq51eVMTK0cH4bbMp9oz9lz0qxIJDWRvi+5P8LCg7Fr /0Rh0w+6J/1zsv3Z+E8AjEtYFxJZfmTYmPVjwByxnVyT7eM78FvImtFFAuhVzNuoadNK We9hyq5FgcxVON7KPu2i0Px6gw+yXDcp2pNbaj1Xtv854T1QuOCCs1/KHw1gJulIZSWJ cNZxIGi3y2q6kJhgCOjUSP7rOwJn/PfbzDpp71AO1ICthYp0cIGhTIts6vSNuqKGAMmE eYU5vBp1UPcxGrWe2lwNjx8s5X670km6EYEBjDafoONTZwJiRO6Do0c4JfSwNVRjULjp fJSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LZfQijIPZfgdgNQuqsuqEELqF8EHTRS+Co8vtfK6lw8=; b=HfLCblOBoX9t6fkFEF6dXj4WZSJRG8hFoF1zOO3Co45WS+nLqMMcYJyqmpS+d7oBt0 TteHwRSCvV679610XsaC+b7+cQs3DtCi85f677sHCWRsIH9htCuRCMLpV2r6ISBOW5Yn SNrpjrHq5QimTW/8vhAPZKgDoiXkHkxw0tKrfodUp/kJzqig2G7SqRyQdnca67zAvbht 8r7KilDuMlPDg+2jcBxt86JeCA5M8oFYDHt1v6sBPwTyV76DgegGe/1s0AaX5i3dZASU lqzVpvdbNALRASzn3WzqAZh5SBbuxMefZCTLTcVrCza735hZ2dSFWSMYyCi/1WeLODiH Vs/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mMcDdB3e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22-v6si13630387pgm.258.2018.09.16.08.15.24; Sun, 16 Sep 2018 08:15:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mMcDdB3e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728283AbeIPUie (ORCPT + 99 others); Sun, 16 Sep 2018 16:38:34 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34730 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbeIPUid (ORCPT ); Sun, 16 Sep 2018 16:38:33 -0400 Received: by mail-wr1-f68.google.com with SMTP id g33-v6so14834717wrd.1; Sun, 16 Sep 2018 08:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LZfQijIPZfgdgNQuqsuqEELqF8EHTRS+Co8vtfK6lw8=; b=mMcDdB3eg30bIW5S0upN1pIjmIRnoobHHxM8pYqTaxC7+/HRUyZaC80wBWTLMeFPC7 WE7dknRSgUXuBUvs4E38uropSPQAS4wAOomrAk7uuQu9JnBBSc/zv/KBvhcPBJmsQxN4 jMVfhb677gikymz+ErIkdfQB+0hyAMPA75/xLD8zEMPCVuibT2a+ghjncUhPdQJrzo9u LTyHfrottIjBmVCbL4Kcc4XGsB5o6vHMV7X+KyncNjIrMVznVT8qOmThTqGrtrAb576P bhi/Liz0zCbkmdg2eUV4gmNU+igqNZFJq0r+/HTeB3HdlTQISm6OdP+Uvk4+wPn+kvus q2xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LZfQijIPZfgdgNQuqsuqEELqF8EHTRS+Co8vtfK6lw8=; b=DMk3KSYwjmTNZS5ebxRlBf8VY6VaZs0YVQYTPH+Sa4h//USp8XXtWGtP/C84Sw9Sef s/xt50X2WJOb0xHcZ9qI8E7B4e+4K7hphfXkFY4TByhODGewNi0qb7U7eVQSahsk4mlA s1ebZaIsHb1SHQZIVk53cYnK/hkhkiexif6/sch0S51A5oBzMtsVMQLatsHPnkmNpakX 5gkyQMbcRu6r98zCnz6nPqD822g30jGwUS9wFiNNfiYRP8t04UZ3hlcPp4Cbq8V1lAuK GA7sAj4uweN0MkMmZJKXIalvp+rflzW1q9FfV8bxRc0Z5Xe4F2AGO85QzrUXdhQgsTk3 7/sQ== X-Gm-Message-State: APzg51DEI00niRZoFCqmZfqAKkJ367rbrG+mVcq5H4kUlO8o0wbJHM0G 06Hs5FDKvceZgF+8cIGjEFU= X-Received: by 2002:adf:8567:: with SMTP id 94-v6mr16345547wrh.223.1537110915934; Sun, 16 Sep 2018 08:15:15 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id a6-v6sm4930662wmf.22.2018.09.16.08.15.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Sep 2018 08:15:15 -0700 (PDT) Date: Sun, 16 Sep 2018 08:15:13 -0700 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 Subject: Re: [PATCH] iio: adc: max9611: Avoid implicit enum conversion warning Message-ID: <20180916151513.GA10200@flashbox> References: <20180915052511.2243-1-natechancellor@gmail.com> <20180916105351.1bf859ee@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180916105351.1bf859ee@archlinux> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 16, 2018 at 10:53:51AM +0100, Jonathan Cameron wrote: > On Fri, 14 Sep 2018 22:25:11 -0700 > Nathan Chancellor wrote: > > > 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 > How does this interact with the patch that Stefan Agner sent for > the same issue last week? > > https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=b1ec0802503820ccbc894aadfd2a44da20232f5e > > Thanks, > > Jonathan > Hi Jonathan, Sorry for the overlap. My patch is not necessary. I was working off of linux-next so I didn't catch this. I'll be better about checking maintainer trees before sending patches in the future. Thanks for the quick response! Nathan > > --- > > 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 >