All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lewis Huang <lewis.huang@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Subject: drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing pointer to 0
Date: Fri, 15 Dec 2023 07:48:26 +0800	[thread overview]
Message-ID: <202312150759.RDeuSwNA-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c7402612e2e61b76177f22e6e7f705adcbecc6fe
commit: 5911d02cac70d7fb52009fbd37423e63f8f6f9bc drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox
date:   4 weeks ago
config: x86_64-randconfig-104-20231214 (https://download.01.org/0day-ci/archive/20231215/202312150759.RDeuSwNA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231215/202312150759.RDeuSwNA-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312150759.RDeuSwNA-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing pointer to 0

vim +532 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

   505	
   506	enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub,
   507					       const struct dmub_srv_memory_params *params,
   508					       struct dmub_srv_fb_info *out)
   509	{
   510		uint8_t *cpu_base;
   511		uint64_t gpu_base;
   512		uint32_t i;
   513	
   514		if (!dmub->sw_init)
   515			return DMUB_STATUS_INVALID;
   516	
   517		memset(out, 0, sizeof(*out));
   518	
   519		if (params->region_info->num_regions != DMUB_NUM_WINDOWS)
   520			return DMUB_STATUS_INVALID;
   521	
   522		cpu_base = (uint8_t *)params->cpu_fb_addr;
   523		gpu_base = params->gpu_fb_addr;
   524	
   525		for (i = 0; i < DMUB_NUM_WINDOWS; ++i) {
   526			const struct dmub_region *reg =
   527				&params->region_info->regions[i];
   528	
   529			out->fb[i].cpu_addr = cpu_base + reg->base;
   530			out->fb[i].gpu_addr = gpu_base + reg->base;
   531	
 > 532			if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) {
   533				out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr + reg->base;
   534				out->fb[i].gpu_addr = params->gpu_inbox_addr + reg->base;
   535			}
   536	
   537			out->fb[i].size = reg->top - reg->base;
   538		}
   539	
   540		out->num_fb = DMUB_NUM_WINDOWS;
   541	
   542		return DMUB_STATUS_OK;
   543	}
   544	

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

                 reply	other threads:[~2023-12-14 23:48 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=202312150759.RDeuSwNA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=lewis.huang@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=oe-kbuild-all@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.