Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2064726ybt; Mon, 15 Jun 2020 17:32:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvus4oZbYwseHwsxdhOhYSpWfaa3wN96ZwGgJfAS4gfUZWaa3gVgivMrz9mcnxA7nWXPjB X-Received: by 2002:a17:906:7746:: with SMTP id o6mr375239ejn.75.1592267540800; Mon, 15 Jun 2020 17:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592267540; cv=none; d=google.com; s=arc-20160816; b=OXloJvo+Lmje+n2PMUiXqmzLMqUp+GEZdfhGsO8+gfaApUGsydqrmn43YsmIbOCiOf lbooiTVD55R0ZIHyH6blt7gowXyeepbBPcfvBU1gK+ky/7OiOguvUxYQ+34L5eO5rbxc 4rXHtSQHkTVD+oHx1njcYIUYkZ2g8LKu2falmePP2luMLRqLXAkr7DcreQivgcT/5+B1 kvCjsZO28TDtpICcsBnhDnMRhegDjsUvFm8/nrQ08Gv49ksoopeMM0ojlNYC9VME419M MbUGGq77G/uSBrB7ekLDVTytOgEOtP1haxBmwyC53IDSzSLlimQ+d0xFxxvDuIiyVnCv mD5w== 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=0+i3xhPEZXa0gRiDvTRs3pZ+q40HmUbfs/tMCxOEi04=; b=uC1GRkzqo3JpY/QGDXv0gRrpu2mTecSriXVo14XjF66UlOUjrISF+v5vMKKcE6mRuv +78SoSv70W0ntpxfeiLDJgCxqUzrxiON2AApbj5O3yiD5AKvv5SCmUqXu5dBtEC1ILfr hfp9pM2tITpaAerB2qH9D/RxIErin+QeOFPK6+fzSGsH4VoPlThTJp36+r+4yR1jNYPr xyESByHtomEzvJbbYeUuKqM7I/x2DS6uuqU7jwX5bJkreAcTMTRBHWBzXrap3Nf4q7q4 zc+s8L1xJSkRQFsM0WKZ+FQB2lKNoGad19fmi79vnAPADVPcPBiiuNrsyY2WbbxfjZGq LhWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SWVn3c8e; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa9si10288088ejb.171.2020.06.15.17.31.58; Mon, 15 Jun 2020 17:32:20 -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=@gmail.com header.s=20161025 header.b=SWVn3c8e; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726553AbgFPAaK (ORCPT + 99 others); Mon, 15 Jun 2020 20:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgFPAaH (ORCPT ); Mon, 15 Jun 2020 20:30:07 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6789CC061A0E for ; Mon, 15 Jun 2020 17:30:07 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id 97so14651829otg.3 for ; Mon, 15 Jun 2020 17:30:07 -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; bh=0+i3xhPEZXa0gRiDvTRs3pZ+q40HmUbfs/tMCxOEi04=; b=SWVn3c8e2HsMKXeVUuTcfwoTc32Q273CosIMDRrsiMl5ywcgRZPtooEYs2ID/PMZXK o8svu/VgECYicxcp0b5gmBXikveqz8kw+1PxYvgfwWqjFNXW73JI9qoQ+wDzPDUF1ueI YddvNfVNWOVGKo1v/a1DlZHb2pPIzWTlldT2DtjRDPFdlNxL8JrB/iSOovRNFgufxAdH hgUZVAY6Vxd2D2JJ2eQjAaL3JC8aIe37anbrTvvxGHiMk20J+Z/nGYT9R2QDVArjMCEY y5pyfILlQsMEcmb+X/jqBsuwPAu4c+MWh3jFkGgCLwuA9IAyJHCsnwjrza83dW/2wgFd 187w== 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; bh=0+i3xhPEZXa0gRiDvTRs3pZ+q40HmUbfs/tMCxOEi04=; b=hDzZ/2+9yslsvShUHCAqXKFFu3pPxSe+GlHddubhn4yBvN5iLZNRXCeV3isYx6mcbH LXDSrFFqu4ZX767AjIQwWYB98EHskgQ1Ew1KlEbHOnSgGol7VMQmp2iYyyiKu+MyFVfH uJyjyXG3lA1CaP22Q5vkEvDEhrIffql4hUZoHF1tdrAOfQfPKQHzMMfMRPlJm6dLRLSA WexAUqYwpn3f3gKXf4pn6+keYAhUMy6BDs8C1Z0NFnt4ZM7kdyD23e0UI01CKjTY4dw0 oQOWhe14khZ1Fpma2gHoHoRKnosQhu3AnC7rmvEamzgNzAjv37HK9V+I9hJnrJVvzkLo 1vKQ== X-Gm-Message-State: AOAM533KQYKFevYmZxvl9cCsF2erhoPLxuOQgiBj5gr70x7jllASQG17 yvam9T7mL3FxQ7W8v4iGpaw= X-Received: by 2002:a9d:22aa:: with SMTP id y39mr508401ota.76.1592267406541; Mon, 15 Jun 2020 17:30:06 -0700 (PDT) Received: from ubuntu-n2-xlarge-x86 ([2604:1380:4111:8b00::3]) by smtp.gmail.com with ESMTPSA id y206sm3608448ooa.32.2020.06.15.17.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 17:30:05 -0700 (PDT) Date: Mon, 15 Jun 2020 17:30:04 -0700 From: Nathan Chancellor To: Kishon Vijay Abraham I , Vinod Koul Cc: 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: <20200616003004.GB1307277@ubuntu-n2-xlarge-x86> References: <20200523035043.3305846-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200523035043.3305846-1-natechancellor@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, Nathan