All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [esmil:jh7110 36/43] drivers/gpu/drm/verisilicon/vs_dc.c:731:15-16: WARNING opportunity for swap()
Date: Fri, 15 Dec 2023 18:36:50 +0800	[thread overview]
Message-ID: <202312151854.SXMjpEOs-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Keith Zhao <keith.zhao@starfivetech.com>
CC: Emil Renner Berthing <emil.renner.berthing@canonical.com>

tree:   https://github.com/esmil/linux jh7110
head:   bebe83d360486029c861b78d6f751aa6d857adf9
commit: 5ef253a52e2113e8685c7222ca98fa1d9362445e [36/43] drm/vs: Add KMS crtc&plane
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: riscv-randconfig-r061-20231215 (https://download.01.org/0day-ci/archive/20231215/202312151854.SXMjpEOs-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202312151854.SXMjpEOs-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/verisilicon/vs_dc.c:731:15-16: WARNING opportunity for swap()

vim +731 drivers/gpu/drm/verisilicon/vs_dc.c

5ef253a52e2113 Keith Zhao 2023-12-04  711  
5ef253a52e2113 Keith Zhao 2023-12-04  712  static void update_scale(struct drm_plane_state *state, struct dc_hw_roi *roi,
5ef253a52e2113 Keith Zhao 2023-12-04  713  			 struct dc_hw_scale *scale)
5ef253a52e2113 Keith Zhao 2023-12-04  714  {
5ef253a52e2113 Keith Zhao 2023-12-04  715  	int dst_w = drm_rect_width(&state->dst);
5ef253a52e2113 Keith Zhao 2023-12-04  716  	int dst_h = drm_rect_height(&state->dst);
5ef253a52e2113 Keith Zhao 2023-12-04  717  	int src_w, src_h, temp;
5ef253a52e2113 Keith Zhao 2023-12-04  718  
5ef253a52e2113 Keith Zhao 2023-12-04  719  	scale->enable = false;
5ef253a52e2113 Keith Zhao 2023-12-04  720  
5ef253a52e2113 Keith Zhao 2023-12-04  721  	if (roi->enable) {
5ef253a52e2113 Keith Zhao 2023-12-04  722  		src_w = roi->width;
5ef253a52e2113 Keith Zhao 2023-12-04  723  		src_h = roi->height;
5ef253a52e2113 Keith Zhao 2023-12-04  724  	} else {
5ef253a52e2113 Keith Zhao 2023-12-04  725  		src_w = drm_rect_width(&state->src) >> 16;
5ef253a52e2113 Keith Zhao 2023-12-04  726  		src_h = drm_rect_height(&state->src) >> 16;
5ef253a52e2113 Keith Zhao 2023-12-04  727  	}
5ef253a52e2113 Keith Zhao 2023-12-04  728  
5ef253a52e2113 Keith Zhao 2023-12-04  729  	if (drm_rotation_90_or_270(state->rotation)) {
5ef253a52e2113 Keith Zhao 2023-12-04  730  		temp = src_w;
5ef253a52e2113 Keith Zhao 2023-12-04 @731  		src_w = src_h;
5ef253a52e2113 Keith Zhao 2023-12-04  732  		src_h = temp;
5ef253a52e2113 Keith Zhao 2023-12-04  733  	}
5ef253a52e2113 Keith Zhao 2023-12-04  734  
5ef253a52e2113 Keith Zhao 2023-12-04  735  	if (src_w != dst_w) {
5ef253a52e2113 Keith Zhao 2023-12-04  736  		scale->scale_factor_x = calc_factor(src_w, dst_w);
5ef253a52e2113 Keith Zhao 2023-12-04  737  		scale->enable = true;
5ef253a52e2113 Keith Zhao 2023-12-04  738  	} else {
5ef253a52e2113 Keith Zhao 2023-12-04  739  		scale->scale_factor_x = 1 << 16;
5ef253a52e2113 Keith Zhao 2023-12-04  740  	}
5ef253a52e2113 Keith Zhao 2023-12-04  741  	if (src_h != dst_h) {
5ef253a52e2113 Keith Zhao 2023-12-04  742  		scale->scale_factor_y = calc_factor(src_h, dst_h);
5ef253a52e2113 Keith Zhao 2023-12-04  743  		scale->enable = true;
5ef253a52e2113 Keith Zhao 2023-12-04  744  	} else {
5ef253a52e2113 Keith Zhao 2023-12-04  745  		scale->scale_factor_y = 1 << 16;
5ef253a52e2113 Keith Zhao 2023-12-04  746  	}
5ef253a52e2113 Keith Zhao 2023-12-04  747  }
5ef253a52e2113 Keith Zhao 2023-12-04  748  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-12-15 10:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202312151854.SXMjpEOs-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.