Re: [PATCH 1/1] drm/prime: Use sg_dma_len() macro to get sg's length

From: kbuild test robot
Date: Mon Jan 07 2019 - 05:43:31 EST


Hi Vivek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc1 next-20190107]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Vivek-Gautam/drm-prime-Use-sg_dma_len-macro-to-get-sg-s-length/20190107-181350
config: x86_64-randconfig-x013-201901 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/gpu/drm/drm_prime.c: In function 'drm_prime_sg_to_page_addr_arrays':
>> drivers/gpu/drm/drm_prime.c:948:9: error: implicit declaration of function 'sg_dma_length'; did you mean 'sg_dma_len'? [-Werror=implicit-function-declaration]
len = sg_dma_length(sg);
^~~~~~~~~~~~~
sg_dma_len
cc1: some warnings being treated as errors

vim +948 drivers/gpu/drm/drm_prime.c

926
927 /**
928 * drm_prime_sg_to_page_addr_arrays - convert an sg table into a page array
929 * @sgt: scatter-gather table to convert
930 * @pages: optional array of page pointers to store the page array in
931 * @addrs: optional array to store the dma bus address of each page
932 * @max_entries: size of both the passed-in arrays
933 *
934 * Exports an sg table into an array of pages and addresses. This is currently
935 * required by the TTM driver in order to do correct fault handling.
936 */
937 int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
938 dma_addr_t *addrs, int max_entries)
939 {
940 unsigned count;
941 struct scatterlist *sg;
942 struct page *page;
943 u32 len, index;
944 dma_addr_t addr;
945
946 index = 0;
947 for_each_sg(sgt->sgl, sg, sgt->nents, count) {
> 948 len = sg_dma_length(sg);
949 page = sg_page(sg);
950 addr = sg_dma_address(sg);
951
952 while (len > 0) {
953 if (WARN_ON(index >= max_entries))
954 return -1;
955 if (pages)
956 pages[index] = page;
957 if (addrs)
958 addrs[index] = addr;
959
960 page++;
961 addr += PAGE_SIZE;
962 len -= PAGE_SIZE;
963 index++;
964 }
965 }
966 return 0;
967 }
968 EXPORT_SYMBOL(drm_prime_sg_to_page_addr_arrays);
969

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip