Re: [PATCH] firmware: gsmi: Drop the use of dma_pool_* API functions

From: kernel test robot
Date: Wed Oct 21 2020 - 03:52:36 EST


Hi Furquan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on linux/master v5.9 next-20201021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Furquan-Shaikh/firmware-gsmi-Drop-the-use-of-dma_pool_-API-functions/20201021-130247
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c4d6fe7311762f2e03b3c27ad38df7c40c80cc93
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/66886f5e6d40e829b8a48ab2dbb6615b906290a5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Furquan-Shaikh/firmware-gsmi-Drop-the-use-of-dma_pool_-API-functions/20201021-130247
git checkout 66886f5e6d40e829b8a48ab2dbb6615b906290a5
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/firmware/google/gsmi.c: In function 'gsmi_page_alloc':
>> drivers/firmware/google/gsmi.c:170:6: warning: right shift count >= width of type [-Wshift-count-overflow]
170 | >> 32) {
| ^~

vim +170 drivers/firmware/google/gsmi.c

151
152 static struct gsmi_page *gsmi_page_alloc(void)
153 {
154 struct gsmi_page *page_info;
155
156 page_info = kzalloc(sizeof(*page_info), GFP_KERNEL);
157 if (!page_info) {
158 printk(KERN_ERR "gsmi: out of memory\n");
159 return NULL;
160 }
161
162 page_info->base_address = get_zeroed_page(GFP_KERNEL | GFP_DMA32);
163 if (!page_info->base_address) {
164 printk(KERN_ERR "gsmi: failed to allocate page for buffers\n");
165 return NULL;
166 }
167
168 /* Ensure the entire buffer is allocated within 32bit address space */
169 if (virt_to_phys((void *)(page_info->base_address + PAGE_SIZE - 1))
> 170 >> 32) {
171 printk(KERN_ERR "gsmi: allocation not within 32-bit physical address space\n");
172 free_page(page_info->base_address);
173 kfree(page_info);
174 return NULL;
175 }
176
177 page_info->alloc_size = PAGE_SIZE;
178
179 return page_info;
180 }
181

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip