Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp526612ybt; Wed, 24 Jun 2020 05:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz074k8976Xmxi25EiDtUFKv0yMoBZGFg0psdpcxcJieYWqHBWwhwgnnmX2cB77js+2yOI5 X-Received: by 2002:a17:906:7d97:: with SMTP id v23mr23784848ejo.199.1593000891856; Wed, 24 Jun 2020 05:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593000891; cv=none; d=google.com; s=arc-20160816; b=U2vUOwoZSqm3KLbRGnU1kFTQ+FHfSSiJe9wJjnTL9QH/XlbcHV9fxrDTAs1Rrc9rWr +tWNPB0gVEC3768qlvpQPku2ow6hxehCq3a6KMEXMAii18cBn5GCK4pJtLiacHtImERV 5YXFo5w/HVs/PO74OyfMWtoIIDkR7Bct/2E/nUYaU6E2NY3bSVNt2xcpar3xB72nSI+J PSaeFpa/2nwut04x/CoQEMJbMH7GwK0JtF2dkCDarc+moz8qtw2wTdH5hdUDD08/fZkS 6BcV5iKkYnoPdjtmeDoHOA3fRTEnj4guUmT3c4uB/+KfnKhXuOXsU1/qRdK/f6VmqSHy e/dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=I8aqB8tSAfssUaQ97QmBJvtULymoPdf6/cVTFWf3LME=; b=IVGos/dZ+xQO7tkvTwrUfvP0UI6VU5KB8QtyU8rE4FtAAm45t8ByTQenfVEelytvxP u0v3S5QwGLV/na9tT9YtvQcUxz0SW1HXMnofRN/fTh8dobGddfb51M22/DJiRB2NHUf0 Q3xifDFWo2geBx5tUSE8cbzSPwl3Oggqx5rPikVkdjAuQ7EjF/V11tSkS/KZufzCMQDM Ycs+pRdZSL4gNuF6TIXWb15cIwEB+KaC4ShYImoQfff7JDi6QZBC3cl7jtG2JtRGIRR9 vfNUQy71lv514TpsT4rm5ij3JCB6ckTiO934lOjThMymw+NsdUAr6P5aMEeWcJkWfL7f Fwmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AkHPlmFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v1si10707586ejd.249.2020.06.24.05.14.28; Wed, 24 Jun 2020 05:14:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=AkHPlmFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2390265AbgFXMN3 (ORCPT + 99 others); Wed, 24 Jun 2020 08:13:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:48956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388811AbgFXMN2 (ORCPT ); Wed, 24 Jun 2020 08:13:28 -0400 Received: from localhost (unknown [171.61.66.58]) (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 D9BA62088E; Wed, 24 Jun 2020 12:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593000807; bh=k5aJPIUQtuGKmsQnsAtOLsmnYCwAV+fYGVXQ7sK6b88=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AkHPlmFsIMH0YQj9EeTwKg1qiipF1q8RUudWPZmSXczMMRIssKC4jBnGgX5o9Sk1A gqlSgqT+qZ0uwxJfYfKEzaJNgGDjhOq8/CeZepiledKAYqZMlg0vY8TyORDZ77MbTD TcMqBbbV2Rj+J2tdMxFtDOvXOay7yZdGklLZogTQ= Date: Wed, 24 Jun 2020 17:43:23 +0530 From: Vinod Koul To: Nathan Chancellor Cc: Kishon Vijay Abraham I , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] phy: intel: Eliminate unnecessary assignment in intel_cbphy_set_mode Message-ID: <20200624121323.GB2324254@vkoul-mobl> References: <20200523035043.3305846-1-natechancellor@gmail.com> <20200616003004.GB1307277@ubuntu-n2-xlarge-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616003004.GB1307277@ubuntu-n2-xlarge-x86> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15-06-20, 17:30, Nathan Chancellor wrote: > On Fri, May 22, 2020 at 08:50:43PM -0700, Nathan Chancellor wrote: > > Clang warns: > > > > drivers/phy/intel/phy-intel-combo.c:202:34: warning: implicit conversion > > from enumeration type 'enum intel_phy_mode' to different enumeration > > type 'enum intel_combo_mode' [-Wenum-conversion] > > enum intel_combo_mode cb_mode = PHY_PCIE_MODE; > > ~~~~~~~ ^~~~~~~~~~~~~ > > 1 warning generated. > > > > The correct enum to use would be PCIE0_PCIE1_MODE. However, eliminating > > this assignment is a little better because the switch statement always > > assigns a new value to cb_mode, which also takes care of the warning. > > > > Fixes: ac0a95a3ea78 ("phy: intel: Add driver support for ComboPhy") > > Link: https://github.com/ClangBuiltLinux/linux/issues/1034 > > Signed-off-by: Nathan Chancellor > > --- > > drivers/phy/intel/phy-intel-combo.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/phy/intel/phy-intel-combo.c b/drivers/phy/intel/phy-intel-combo.c > > index c2a35be4cdfb..4bc1276ecf23 100644 > > --- a/drivers/phy/intel/phy-intel-combo.c > > +++ b/drivers/phy/intel/phy-intel-combo.c > > @@ -199,9 +199,9 @@ static int intel_cbphy_pcie_dis_pad_refclk(struct intel_cbphy_iphy *iphy) > > > > static int intel_cbphy_set_mode(struct intel_combo_phy *cbphy) > > { > > - enum intel_combo_mode cb_mode = PHY_PCIE_MODE; > > enum aggregated_mode aggr = cbphy->aggr_mode; > > struct device *dev = cbphy->dev; > > + enum intel_combo_mode cb_mode; > > enum intel_phy_mode mode; > > int ret; > > > > > > base-commit: c11d28ab4a691736e30b49813fb801847bd44e83 > > -- > > 2.27.0.rc0 > > > > Gentle ping for review. Nick did comment that maybe keeping the > assignment and tidying up one of the switch cases would be better but > every maintainer has their preference. This warning has slipped into > mainline so it would be nice to get it cleaned up. Sorry for the delay, I have applied Anrd patch for this already and should be in linux-next tomorrow -- ~Vinod