Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7905831ybi; Thu, 6 Jun 2019 03:32:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgvcDtn8V16awLBiDEiJLbI62whm/Vt75RHeTaucdE4dDWMyUB75PNy62GNUVj8OWWkX99 X-Received: by 2002:a17:902:ac82:: with SMTP id h2mr50029976plr.303.1559817163888; Thu, 06 Jun 2019 03:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559817163; cv=none; d=google.com; s=arc-20160816; b=g7VBf/ccrlXv5GfoNWj0YXcnUpnoGFVBAhvlb2tFtKxRdcsM2sHsW5RL1EqfvJY7Wh IjzntQuZ5QyPieZKF3TWPa+M67qt2fzlzcrqWmF81/31bd+utVGoIpNH/NOgZtrhMHRA J4/dzQJ77OwkeeniIxjwR7qp9tVUVv/wEyIK4G47xKGEQ5oHwkvMguEprfhaluATEy0Y WZvt383Zfn+NQaMpkWul6URxc7aURpvhKhuTfMjsfzsLqGchRyDdnYyaTRD9C248ir3t 38GRGlrA9daI0pVZYnqtlELZDjqyVs6LuE/L6yE46kkkbbcoVpCGdPlvuVbW2eU0JYwI fEoA== 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=chC2ESL5ETHD38DyfimbY9RtBdco74fFfMWbdfWI37s=; b=FIkEanSkxxrc1m0uaXZkTO04C5Skxn6BvRN+NBxfH4pwaWPBD0l/qsWzUdx9KR3v9j 1sXJTabVjzssuSm91gTzvGTxoQ99AlAdgjXeRUn5kT6qJywgtk+ldrlElH0FFBQiHy+X kezaFlYhP4EkwwDTNrSx3XggCJwe+vy5FJL95uOaKMqL5zv/Y20XpoH7OjZfT+QLhC7A CS0tz8XBZ5LsdVAmtC7ZmUlVnIa3DSB5RLE45nhUbarYMGPqnhg4D/rreasPOvS1Dorl k8Qrk/f8wxVM34raPb1md0Nyr5tDswiwnKLoPxJ4vlDzMzCf9Wr5R6hvNfKKDs80q14z 0P8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=sPdb6bVX; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18si1487342plq.104.2019.06.06.03.32.26; Thu, 06 Jun 2019 03:32:43 -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=@oracle.com header.s=corp-2018-07-02 header.b=sPdb6bVX; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbfFFKbT (ORCPT + 99 others); Thu, 6 Jun 2019 06:31:19 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:34168 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfFFKbT (ORCPT ); Thu, 6 Jun 2019 06:31:19 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x56AOfEE090289; Thu, 6 Jun 2019 10:31:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=chC2ESL5ETHD38DyfimbY9RtBdco74fFfMWbdfWI37s=; b=sPdb6bVX9Qok6LhENtfhx82iUfg9TJljlGnbqE8wGy5gxt8GL3y4zis/zphkxNW7ytSS 0z2P5b8rPGUO9RKFph0zdIQnjCXHnzJiqEfOrykw5BfTtZ7Im1n8/I1cJjiWak4KfFtI NTM9sGIjh7nOC9SC8gMTVzrNQ2nYW7vdxO0JqrX6ZA2VB8WgAxfghcSYAOw4BXlaScVG uQQ8gwS+XcUqunslovdAIwhut5tAYIuzFS9g9iOcIz/UX0+xX1VHS9nGvIS1mJIbXYPf QNKshbVFTnwlufNr3Fh5Bxm9RPCSva2zs+7dXYwnQF/XtXepcFf/X9/FBPMq850Ic2fc eg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2sugstqkkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 10:31:10 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x56AV4M4026798; Thu, 6 Jun 2019 10:31:10 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2swngmedha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2019 10:31:09 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x56AV5up032634; Thu, 6 Jun 2019 10:31:06 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Jun 2019 03:31:05 -0700 Date: Thu, 6 Jun 2019 13:30:55 +0300 From: Dan Carpenter To: Harry Wentland Cc: Colin King , "Koo, Anthony" , "Wentland, Harry" , "Li, Sun peng (Leo)" , "Deucher, Alexander" , "Koenig, Christian" , "Zhou, David(ChunMing)" , David Airlie , Daniel Vetter , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH][next] drm/amd/display: remove redundant assignment to status Message-ID: <20190606103055.GJ31203@kadam> References: <20190530161219.2507-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060076 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9279 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060076 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 08:19:03PM +0000, Harry Wentland wrote: > On 2019-05-30 12:12 p.m., Colin King wrote: > > From: Colin Ian King > > > > The variable status is initialized with a value that is never read > > and status is reassigned several statements later. This initialization > > is redundant and can be removed. > > > > Addresses-Coverity: ("Unused value") > > Signed-off-by: Colin Ian King > > --- > > drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > > index 65d6caedbd82..cf6166a1be53 100644 > > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > > @@ -2367,7 +2367,7 @@ static bool retrieve_link_cap(struct dc_link *link) > > union down_stream_port_count down_strm_port_count; > > union edp_configuration_cap edp_config_cap; > > union dp_downstream_port_present ds_port = { 0 }; > > - enum dc_status status = DC_ERROR_UNEXPECTED; > > + enum dc_status status; > > Not sure this improves the situation. > > I'd prefer to have a default here in case someone changes the code below > and forgets to set the status. The dead code confuses human readers, because people naturally assume it is not dead. GCC has a feature to warn about uninitialized variables and we're randomly initializing status to a bogus value to disable static analysis... regards, dan carpenter