Message ID | 20230531021714.125078-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2595697vqr; Tue, 30 May 2023 19:36:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+CCzjjgQP5TyJK5dusvYpq+GeG/XtMtwHvFmah9SQddyZ3Zg5VW5C9apdaeCQNcwF1jS2 X-Received: by 2002:a05:6a20:3d03:b0:10e:d134:d686 with SMTP id y3-20020a056a203d0300b0010ed134d686mr5092045pzi.6.1685500601050; Tue, 30 May 2023 19:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685500601; cv=none; d=google.com; s=arc-20160816; b=jyakZgyp6ysUbhSyRHBtmIfd90AkiZ9g2b7js2eeMcHRUnVe4JeabuHEQUH31CykwG baoStIWddcZ7l3V7Qe547FLVWM8foYOg700RzBKGvlaYXice4Blwyrb32aIPRt9n6c5b P43RkC1DsDAwwcSgkOSxHvMyKuazRhLGFBJOCRDgZuT4s0nHyTOwCVWQSXHm1wgknxN/ /c8eBFEwQW/7P9F9RwGXUQpX5pGKcQyRoP6BlWdhUE91wOl/SQ1iIrUYXsB6xBnM5Htp Z+ubNT1db+nfVaTibhjsNYsFCJqNPSj5eO7snQ6qFOfeIF+j6zyGPnxCVjNOwQn5vvpG C7ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FmJ3DHTBl64LXVdAW7z0puqWani4RV9QXeKPYa0qoPs=; b=s7BF6waGGq+0ngdlDvZxC6wPIGhaxsZ4FS34PGQBDiXrnfE5lcMSIMun4+ViDhvqnW fpQ7fRnlRxQB140dBznbNqPtm7ywBv9cr31dDCyeKliZdFhNiC31nKlOu+zaRkpRuvde /OGVPDwcy88UyQQ44QwH9wxefS0zmkj8lVZWXVn5mO84C5NisnmV9YekkL/WL/9a8jBL 2ZtF6RKJUAZ3cdnLEY7xSOuRt1A952eLiMeBKpu4wmi4LYvX0kPSiZdbWktAyC1hX3yI D7SEWqSrA0kvb/s1TTzRlsIVrtlZqam6XcGgvUHbtoJ3VDVd8RclsSbCx0m8I9nNo1Mr 6nLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k68-20020a633d47000000b00534e310d0d3si133728pga.588.2023.05.30.19.36.28; Tue, 30 May 2023 19:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbjEaCRX (ORCPT <rfc822;callmefire3@gmail.com> + 99 others); Tue, 30 May 2023 22:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbjEaCRV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 30 May 2023 22:17:21 -0400 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E70EC for <linux-kernel@vger.kernel.org>; Tue, 30 May 2023 19:17:19 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VjvXEdn_1685499435; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VjvXEdn_1685499435) by smtp.aliyun-inc.com; Wed, 31 May 2023 10:17:16 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: airlied@gmail.com Cc: daniel@ffwll.ch, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH -next] drm/i915: remove unreachable code Date: Wed, 31 May 2023 10:17:14 +0800 Message-Id: <20230531021714.125078-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767375478281955765?= X-GMAIL-MSGID: =?utf-8?q?1767375478281955765?= |
Series |
[-next] drm/i915: remove unreachable code
|
|
Commit Message
Yang Li
May 31, 2023, 2:17 a.m. UTC
The code after the return will not be executed, so remove them.
Eliminate the following warning:
drivers/gpu/drm/i915/display/intel_color.c:1808 intel_color_prepare_commit() warn: ignoring unreachable code.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5342
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/gpu/drm/i915/display/intel_color.c | 5 -----
1 file changed, 5 deletions(-)
Comments
Hi Yang, On Wed, May 31, 2023 at 10:17:14AM +0800, Yang Li wrote: > The code after the return will not be executed, so remove them. > > Eliminate the following warning: > drivers/gpu/drm/i915/display/intel_color.c:1808 intel_color_prepare_commit() warn: ignoring unreachable code. > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5342 > Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> > --- > drivers/gpu/drm/i915/display/intel_color.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c > index 8966e6560516..0bfebac1e3e2 100644 > --- a/drivers/gpu/drm/i915/display/intel_color.c > +++ b/drivers/gpu/drm/i915/display/intel_color.c > @@ -1804,11 +1804,6 @@ void intel_color_prepare_commit(struct intel_crtc_state *crtc_state) > > /* FIXME DSB has issues loading LUTs, disable it for now */ > return; > - > - if (!crtc_state->pre_csc_lut && !crtc_state->post_csc_lut) > - return; > - > - crtc_state->dsb = intel_dsb_prepare(crtc, 1024); yeah... it's an ugly bit, from my side: Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> but would be nice to hear from Ville who has added the return in a first place. Andi > } > > void intel_color_cleanup_commit(struct intel_crtc_state *crtc_state) > -- > 2.20.1.7.g153144c
Hi Yang,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20230530]
url: https://github.com/intel-lab-lkp/linux/commits/Yang-Li/drm-i915-remove-unreachable-code/20230531-101832
base: next-20230530
patch link: https://lore.kernel.org/r/20230531021714.125078-1-yang.lee%40linux.alibaba.com
patch subject: [PATCH -next] drm/i915: remove unreachable code
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230531/202305312340.S0eChDKB-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/58232a66b9d21d80bc6b478e2a8fb1443da3adfc
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yang-Li/drm-i915-remove-unreachable-code/20230531-101832
git checkout 58232a66b9d21d80bc6b478e2a8fb1443da3adfc
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305312340.S0eChDKB-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/display/intel_color.c: In function 'intel_color_prepare_commit':
>> drivers/gpu/drm/i915/display/intel_color.c:1803:28: error: unused variable 'crtc' [-Werror=unused-variable]
1803 | struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
| ^~~~
cc1: all warnings being treated as errors
vim +/crtc +1803 drivers/gpu/drm/i915/display/intel_color.c
3962ca4e080a52 Ville Syrjälä 2023-03-20 1800
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1801 void intel_color_prepare_commit(struct intel_crtc_state *crtc_state)
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1802 {
b358c3b98813b1 Ville Syrjälä 2022-11-23 @1803 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
b358c3b98813b1 Ville Syrjälä 2022-11-23 1804
2487ae0bcb53a7 Ville Syrjälä 2022-11-23 1805 /* FIXME DSB has issues loading LUTs, disable it for now */
2487ae0bcb53a7 Ville Syrjälä 2022-11-23 1806 return;
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1807 }
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1808
Hi Yang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20230530]
url: https://github.com/intel-lab-lkp/linux/commits/Yang-Li/drm-i915-remove-unreachable-code/20230531-101832
base: next-20230530
patch link: https://lore.kernel.org/r/20230531021714.125078-1-yang.lee%40linux.alibaba.com
patch subject: [PATCH -next] drm/i915: remove unreachable code
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20230601/202306010001.gUxZYcyb-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/58232a66b9d21d80bc6b478e2a8fb1443da3adfc
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yang-Li/drm-i915-remove-unreachable-code/20230531-101832
git checkout 58232a66b9d21d80bc6b478e2a8fb1443da3adfc
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306010001.gUxZYcyb-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/display/intel_color.c: In function 'intel_color_prepare_commit':
>> drivers/gpu/drm/i915/display/intel_color.c:1803:28: warning: unused variable 'crtc' [-Wunused-variable]
1803 | struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
| ^~~~
vim +/crtc +1803 drivers/gpu/drm/i915/display/intel_color.c
3962ca4e080a52 Ville Syrjälä 2023-03-20 1800
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1801 void intel_color_prepare_commit(struct intel_crtc_state *crtc_state)
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1802 {
b358c3b98813b1 Ville Syrjälä 2022-11-23 @1803 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
b358c3b98813b1 Ville Syrjälä 2022-11-23 1804
2487ae0bcb53a7 Ville Syrjälä 2022-11-23 1805 /* FIXME DSB has issues loading LUTs, disable it for now */
2487ae0bcb53a7 Ville Syrjälä 2022-11-23 1806 return;
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1807 }
efb2b57edf20c3 Ville Syrjälä 2022-11-23 1808
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 8966e6560516..0bfebac1e3e2 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1804,11 +1804,6 @@ void intel_color_prepare_commit(struct intel_crtc_state *crtc_state) /* FIXME DSB has issues loading LUTs, disable it for now */ return; - - if (!crtc_state->pre_csc_lut && !crtc_state->post_csc_lut) - return; - - crtc_state->dsb = intel_dsb_prepare(crtc, 1024); } void intel_color_cleanup_commit(struct intel_crtc_state *crtc_state)