drm/amdgpu: implement cgs gpu memory callbacks

Dan Carpenter dan.carpenter at oracle.com
Mon Aug 24 12:51:08 PDT 2015


On Mon, Aug 24, 2015 at 07:09:15AM +0000, Zhou, David(ChunMing) wrote:
> Hi Dan,
> Thanks for figuring out that. 
> >    274          min_offset = obj->placements[0].fpfn << PAGE_SHIFT;
> >    275          max_offset = obj->placements[0].lpfn << PAGE_SHIFT;
> Maybe should be:
> 	min_offset = obj->placements[0].fpfn;
> 	min_offset <<= PAGE_SHIFT;
> 	max_offset = obj->placements[0].lpfn;
> 	max_offset <<= PAGE_SHIFT;


It's probably just simpler to be:

	min_offset = (u64)obj->placements[0].fpfn << PAGE_SHIFT;
	max_offset = (u64)obj->placements[0].lpfn << PAGE_SHIFT;

But the larger questions aer why is min_offset a u64, and can the shift
actually wrap?  I'm just looking at static checker warnings, and I'm
not very familiar with this code so I don't know the answers.

regards,
dan carpenter



More information about the dri-devel mailing list