Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4352003imm; Mon, 17 Sep 2018 12:22:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNzf2gC4zElxb4nJ0XjgusWi64WF/vICT7sLvIDX7hAsFcXOkG1BJVMW5jBveGnKzw25O0 X-Received: by 2002:a17:902:a405:: with SMTP id p5-v6mr26072775plq.222.1537212146134; Mon, 17 Sep 2018 12:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537212146; cv=none; d=google.com; s=arc-20160816; b=XmEQSaCtypZ3rOt0e1zWyEWp6oTe1/bYM/701PRmKj4J5GqEPS3Ep0FWNYhnEFihNH Uj2nljUCDiIZ2D75e9iMMJ3+3/PZ/aqhcG7yulHDMAsMhSdOrzqXNwa5ATMFcEuJ9j3N ETx4EVOSTzU63gK6UY47oPiqL0HKZn92IFrklSGtykGBmlsoQww/BAVK4YJPoXVCNKqr emqX27HEdn1C69ZQDXV3EYkgcCuUCwPLqFqt+PZQt5HztDkrAByX0htr7ix0I1f8xEHC AXYuK655hd31SP/yKJUsiwUB0GorhFDkIJmPLDjhXxhEtjaNpR8GLUX06RDxEJsW+N1e ej8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=b/FIpbY5R8/nPoPMWiq8TV1BX00JHPCOUHqSODxV3l0=; b=ibotw6/gVpEuJkGCcdjxJDMhLyI8F7Wb+h1a8QHMNyhp2rA1u3W94DjMFZFaYDmEpC TQTwjrTlwBKCfkCPyBTvvn1ruFFlrYbktfsGq6UjY5UxXY0ew1H8m9JmsBf5D86cLmNr XU0hVMrXKTLLmQ+/XakiwQX0eEBUzN/UjXjF34nwBaEKbEpTsvzOdrZQgDDiSTwv7yDN tmNJncNWWYoQFTH9hgEqeUe7+YSY7GRfyN4xK26dd+a+2lQPfz/4vvQjpdeVbYR+w/NZ SbcCDC1MZD8DMyIv5Qxup7A1bA+7Td9+cxY2md37gsyoOAhRxkI3fy4dd8/BPvdxU0gr n9SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b="v0pIH0/5"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u69-v6si15069694pgd.547.2018.09.17.12.22.09; Mon, 17 Sep 2018 12:22:26 -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=@agner.ch header.s=dkim header.b="v0pIH0/5"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728273AbeIRAuq (ORCPT + 99 others); Mon, 17 Sep 2018 20:50:46 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:57530 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbeIRAuq (ORCPT ); Mon, 17 Sep 2018 20:50:46 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id AA6E85C021F; Mon, 17 Sep 2018 21:22:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1537212121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b/FIpbY5R8/nPoPMWiq8TV1BX00JHPCOUHqSODxV3l0=; b=v0pIH0/5EjZqLpEcJP7KQX7wwprS+SxvQ8rb2pNWBx7Ac8dCr9Ww8s4MyMkNJiNf7s1A2e xID/N2mk9qPJv+GwgpHun8cIi4a/kPhr1kBpY8s9Og02K6fg8iYypKd66k3ztz4VOxVnYS EnVZCgfB4peSIRNmo41ut7n04YzWn88= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 17 Sep 2018 12:22:01 -0700 From: Stefan Agner To: Nick Desaulniers Cc: Nathan Chancellor , jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, LKML Subject: Re: [PATCH] iio: adc: max9611: Avoid implicit enum conversion warning In-Reply-To: References: <20180915052511.2243-1-natechancellor@gmail.com> <20180916105351.1bf859ee@archlinux> <20180916151513.GA10200@flashbox> Message-ID: <6cae089a39c7423be9837b89ca50c8e9@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.09.2018 09:52, Nick Desaulniers wrote: > On Sun, Sep 16, 2018 at 8:15 AM Nathan Chancellor > wrote: >> >> 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? > > + Stefan in case he has additional thoughts. I don't feel strongly > about one patch vs the other. > FWIW, only one is needed. I prefer mine slightly over Nicks since it continues to use struct max9611_conf_ids which is the type required by the max9611_read_single() function.. I don't have a strong opinion though, and did not look deeper into why the driver makes the differentiation between struct max9611_conf_ids and ax9611_csa_gain... -- Stefan >> > >> > 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 >> >