we counld use PFN_UP instead of vmw_num_pages() Signed-off-by: Cai Huoqing <caihuoqing@xxxxxxxxx> --- .../gpu/drm/vmwgfx/device_include/vm_basic_types.h | 13 ++++++------- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h b/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h index 35bd2852189f..1f6e3bbc6605 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h +++ b/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h @@ -97,19 +97,18 @@ typedef __attribute__((aligned(32))) struct MKSGuestStatInfoEntry { } MKSGuestStatInfoEntry; #define INVALID_PPN64 ((PPN64)0x000fffffffffffffULL) -#define vmw_num_pages(size) (PAGE_ALIGN(size) >> PAGE_SHIFT) #define MKS_GUEST_STAT_INSTANCE_DESC_LENGTH 1024 #define MKS_GUEST_STAT_INSTANCE_MAX_STATS 4096 -#define MKS_GUEST_STAT_INSTANCE_MAX_STAT_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_STAT_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ sizeof(MKSGuestStatCounterTime))) -#define MKS_GUEST_STAT_INSTANCE_MAX_INFO_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_INFO_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ sizeof(MKSGuestStatInfoEntry))) #define MKS_GUEST_STAT_AVERAGE_NAME_LENGTH 40 -#define MKS_GUEST_STAT_INSTANCE_MAX_STRS_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_STRS_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ MKS_GUEST_STAT_AVERAGE_NAME_LENGTH)) /* diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index ed9c7b3a1e08..e50fb82a3030 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c @@ -1016,9 +1016,9 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data, struct page *page; MKSGuestStatInstanceDescriptor *pdesc; - const size_t num_pages_stat = vmw_num_pages(arg->stat_len); - const size_t num_pages_info = vmw_num_pages(arg->info_len); - const size_t num_pages_strs = vmw_num_pages(arg->strs_len); + const size_t num_pages_stat = PFN_UP(arg->stat_len); + const size_t num_pages_info = PFN_UP(arg->info_len); + const size_t num_pages_strs = PFN_UP(arg->strs_len); long desc_len; long nr_pinned_stat; long nr_pinned_info; -- 2.25.1