Re: drm/amdgpu: implement cgs gpu memory callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux