Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2776131imm; Sun, 16 Sep 2018 02:54:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYpwl/xzvoMYuUukdIUsWxpUkYjqS37cyKXvpDtFqungdj+DRn/NibvTqjzSkzN85UcS+Ig X-Received: by 2002:a62:6f87:: with SMTP id k129-v6mr20797819pfc.26.1537091652080; Sun, 16 Sep 2018 02:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537091652; cv=none; d=google.com; s=arc-20160816; b=LIY27nY0nlQIrThZnw7XZgABIHCO8O844vL1AIlyKLpgpq23a9NTeJH3xG8Cu7BAFZ 7k/AhKSGTu/Js1jQUvC8wOpXGT9PJz+1xub0z2NP+XUD3ooILuRsT/MPYoleiFnmX+nV nYyhA4AB/45rIaNImcx8TrrsCoETy8BjwxuRn7YozTp2nbJ74jzVTUms/Qb4+eAmU2S4 /0AN2UP741s8jCRYUYzg2xw4FNm4CMXtoyjNWDeGotIl47D8i+J0mstk7+Ai7sD7ERrS 8gip6tolzmmoyoVOIv2kRpBz7I/DotcPddBczHK6tzxwNV7rlSFANa90khVNb3XQ0e45 q4gA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Toe+AjKh20NsPc+bClpB1AC0/wTucyK4VbrLqtz9IeY=; b=ICZHBi2ZHwb2u3kBzMY+yvQ6fYDrQv0z7mmsFob0kp4mH6a9ZlFlFuM2zuluig+as7 h+/CHka9VlY81b8az1yk1m80nYxwmygZ1saj99ak9lCDxEnaiuaK7Yruj06MiLszrwam h++Ax3zfir78Pv0n527+Fc0MspJSpMn/cnO1OF3LEYCNciONxNQhvaqsxt0gZ6RAC/4Z FEV7lYS4phjb2bn2UBOcZFDWp+UFkAbJv+ndtf+MoIV1b5XLOh01sVBeetwzWDpyPZ3M 1llGLma6lL+H5Urt0FKaJ+tDKUGpf4ldEt+MdFHhxUz5WBK1r2nqvWdIz25PVEELFcZb IJYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wXAKJMIH; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si11649376pgp.202.2018.09.16.02.53.55; Sun, 16 Sep 2018 02:54:12 -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=@kernel.org header.s=default header.b=wXAKJMIH; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbeIPPQN (ORCPT + 99 others); Sun, 16 Sep 2018 11:16:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:51170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbeIPPQM (ORCPT ); Sun, 16 Sep 2018 11:16:12 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 BBD242087E; Sun, 16 Sep 2018 09:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1537091630; bh=zYXRem1npSdrQhO+lkWFzin44XSfvZoET9Le8r8yw90=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wXAKJMIHW/6teaVjGvCJAga2JmkHx8phiGXUnmo0kcl0H5e88DqYDjoISIgrERKn+ gKbI/gRO4Z1eIevmBMBTbpAq/2qd8uILuq+wB/Nw9X065+mc9TKNLXVi6nu2KnwrnM QjYa8b+hujelVCx8SNI89wwJaNXihXqIVhIihRi4= Date: Sun, 16 Sep 2018 10:53:51 +0100 From: Jonathan Cameron To: Nathan Chancellor 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: <20180916105351.1bf859ee@archlinux> In-Reply-To: <20180915052511.2243-1-natechancellor@gmail.com> References: <20180915052511.2243-1-natechancellor@gmail.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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