All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: david1.zhou@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/amdgpu: implement cgs gpu memory callbacks
Date: Fri, 21 Aug 2015 19:23:59 +0300	[thread overview]
Message-ID: <20150821162359.GA24695@mwanda> (raw)

Hello Chunming Zhou,

The patch 57ff96cf471a: "drm/amdgpu: implement cgs gpu memory
callbacks" from Apr 24, 2015, leads to the following static checker
warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:274 amdgpu_cgs_gmap_gpu_mem()
	warn: should 'obj->placements[0]->fpfn << 12' be a 64 bit type?

	drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:275 amdgpu_cgs_gmap_gpu_mem()
	warn: should 'obj->placements[0]->lpfn << 12' be a 64 bit type?


drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
   265  static int amdgpu_cgs_gmap_gpu_mem(void *cgs_device, cgs_handle_t handle,
   266                                     uint64_t *mcaddr)
   267  {
   268          int r;
   269          u64 min_offset, max_offset;
   270          struct amdgpu_bo *obj = (struct amdgpu_bo *)handle;
   271  
   272          WARN_ON_ONCE(obj->placement.num_placement > 1);
   273  
   274          min_offset = obj->placements[0].fpfn << PAGE_SHIFT;
   275          max_offset = obj->placements[0].lpfn << PAGE_SHIFT;

Both of these.

   276  
   277          r = amdgpu_bo_reserve(obj, false);
   278          if (unlikely(r != 0))
   279                  return r;
   280          r = amdgpu_bo_pin_restricted(obj, AMDGPU_GEM_DOMAIN_GTT,
   281                                       min_offset, max_offset, mcaddr);
   282          amdgpu_bo_unreserve(obj);
   283          return r;
   284  }

There are actually a few of these warnings which were less clear
whether the warning was correct or not so I didn't send them.

drivers/gpu/drm/amd/amdgpu/cz_smc.c:463 cz_smu_populate_single_firmware_entry() warn: should '((header->jt_offset)) << 2' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/fiji_smc.c:404 fiji_smu_populate_single_firmware_entry() warn: should '((header->jt_offset)) << 2' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c:724 amdgpu_cgs_get_firmware_info() warn: should '((header->jt_offset)) << 2' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/tonga_smc.c:406 tonga_smu_populate_single_firmware_entry() warn: should '((header->jt_offset)) << 2' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:615 amdgpu_gem_op_ioctl() warn: should 'robj->tbo.mem.page_alignment << 12' be a 64 bit type?

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2015-08-21 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 16:23 Dan Carpenter [this message]
2015-08-24  7:09 ` drm/amdgpu: implement cgs gpu memory callbacks Zhou, David(ChunMing)
2015-08-24 19:51   ` Dan Carpenter
2015-08-25  2:07     ` Zhou, David(ChunMing)
2015-08-25  5:50       ` Dan Carpenter
2015-08-25  6:00         ` Zhou, David(ChunMing)

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=20150821162359.GA24695@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=david1.zhou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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.