All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 9419/10007] drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type
Date: Fri, 18 Jun 2021 10:09:22 -0700	[thread overview]
Message-ID: <6c5d6e01-1530-acc2-9737-491bda391ddf@kernel.org> (raw)
In-Reply-To: <20210618094651.2a767516@xps13>

On 6/18/2021 12:46 AM, Miquel Raynal wrote:
> Hello,
> 
> kernel test robot <lkp@intel.com> wrote on Wed, 16 Jun 2021 18:33:22
> +0800:
> 
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   19ae1f2bd9c091059f80646604ccef8a1e614f57
>> commit: 236fd3e0427070413e7059dc3c52c3f9c89f7cc0 [9419/10007] Merge remote-tracking branch 'nand/nand/next'
>> config: riscv-randconfig-r013-20210615 (attached as .config)
>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
>> reproduce (this is a W=1 build):
>>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>          chmod +x ~/bin/make.cross
>>          # install riscv cross compiling tool for clang build
>>          # apt-get install binutils-riscv64-linux-gnu
>>          # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=236fd3e0427070413e7059dc3c52c3f9c89f7cc0
>>          git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>          git fetch --no-tags linux-next master
>>          git checkout 236fd3e0427070413e7059dc3c52c3f9c89f7cc0
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     In file included from include/linux/mm.h:33:
>>     In file included from include/linux/pgtable.h:6:
>>     arch/riscv/include/asm/pgtable.h:521:9: error: implicit declaration of function 'pfn_pmd' [-Werror,-Wimplicit-function-declaration]
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                    ^
>>     arch/riscv/include/asm/pgtable.h:521:9: note: did you mean 'pfn_pgd'?
>>     arch/riscv/include/asm/pgtable.h:222:21: note: 'pfn_pgd' declared here
>>     static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
>>                         ^
>>     arch/riscv/include/asm/pgtable.h:521:17: error: implicit declaration of function 'page_to_section' [-Werror,-Wimplicit-function-declaration]
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                            ^
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>     arch/riscv/include/asm/pgtable.h:521:17: note: did you mean '__nr_to_section'?
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>     include/linux/mmzone.h:1314:35: note: '__nr_to_section' declared here
>>     static inline struct mem_section *__nr_to_section(unsigned long nr)
>>                                       ^
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     In file included from include/linux/mm.h:33:
>>     In file included from include/linux/pgtable.h:6:
>>     arch/riscv/include/asm/pgtable.h:521:9: error: returning 'int' from a function with incompatible result type 'pmd_t'
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     include/linux/mm.h:1552:29: error: static declaration of 'page_to_section' follows non-static declaration
>>     static inline unsigned long page_to_section(const struct page *page)
>>                                 ^
>>     arch/riscv/include/asm/pgtable.h:521:17: note: previous implicit declaration is here
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                            ^
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>>> drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type [-Wshift-count-overflow]
>>             ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
>>                                            ^~~~~~~~~~~~~~~~
>>     include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
>>     #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
>>                                                          ^ ~~~
>>     1 warning and 4 errors generated.
> 
> I'm not sure to understand what the proper fix here. I am also unable
> to reproduce the warning with the above steps.
> 

I think this warning shows up because of the other errors that are 
present in the build log. I do not think there is anything for you to do 
about this warning.

Cheers,
Nathan


WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 9419/10007] drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type
Date: Fri, 18 Jun 2021 10:09:22 -0700	[thread overview]
Message-ID: <6c5d6e01-1530-acc2-9737-491bda391ddf@kernel.org> (raw)
In-Reply-To: <20210618094651.2a767516@xps13>

[-- Attachment #1: Type: text/plain, Size: 5955 bytes --]

On 6/18/2021 12:46 AM, Miquel Raynal wrote:
> Hello,
> 
> kernel test robot <lkp@intel.com> wrote on Wed, 16 Jun 2021 18:33:22
> +0800:
> 
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   19ae1f2bd9c091059f80646604ccef8a1e614f57
>> commit: 236fd3e0427070413e7059dc3c52c3f9c89f7cc0 [9419/10007] Merge remote-tracking branch 'nand/nand/next'
>> config: riscv-randconfig-r013-20210615 (attached as .config)
>> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
>> reproduce (this is a W=1 build):
>>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>          chmod +x ~/bin/make.cross
>>          # install riscv cross compiling tool for clang build
>>          # apt-get install binutils-riscv64-linux-gnu
>>          # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=236fd3e0427070413e7059dc3c52c3f9c89f7cc0
>>          git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>          git fetch --no-tags linux-next master
>>          git checkout 236fd3e0427070413e7059dc3c52c3f9c89f7cc0
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     In file included from include/linux/mm.h:33:
>>     In file included from include/linux/pgtable.h:6:
>>     arch/riscv/include/asm/pgtable.h:521:9: error: implicit declaration of function 'pfn_pmd' [-Werror,-Wimplicit-function-declaration]
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                    ^
>>     arch/riscv/include/asm/pgtable.h:521:9: note: did you mean 'pfn_pgd'?
>>     arch/riscv/include/asm/pgtable.h:222:21: note: 'pfn_pgd' declared here
>>     static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
>>                         ^
>>     arch/riscv/include/asm/pgtable.h:521:17: error: implicit declaration of function 'page_to_section' [-Werror,-Wimplicit-function-declaration]
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                            ^
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>     arch/riscv/include/asm/pgtable.h:521:17: note: did you mean '__nr_to_section'?
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>     include/linux/mmzone.h:1314:35: note: '__nr_to_section' declared here
>>     static inline struct mem_section *__nr_to_section(unsigned long nr)
>>                                       ^
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     In file included from include/linux/mm.h:33:
>>     In file included from include/linux/pgtable.h:6:
>>     arch/riscv/include/asm/pgtable.h:521:9: error: returning 'int' from a function with incompatible result type 'pmd_t'
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
>>     In file included from include/linux/dma-mapping.h:10:
>>     In file included from include/linux/scatterlist.h:8:
>>     include/linux/mm.h:1552:29: error: static declaration of 'page_to_section' follows non-static declaration
>>     static inline unsigned long page_to_section(const struct page *page)
>>                                 ^
>>     arch/riscv/include/asm/pgtable.h:521:17: note: previous implicit declaration is here
>>             return pfn_pmd(page_to_pfn(page), prot);
>>                            ^
>>     include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
>>     #define page_to_pfn __page_to_pfn
>>                         ^
>>     include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
>>             int __sec = page_to_section(__pg);                      \
>>                         ^
>>>> drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type [-Wshift-count-overflow]
>>             ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
>>                                            ^~~~~~~~~~~~~~~~
>>     include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
>>     #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
>>                                                          ^ ~~~
>>     1 warning and 4 errors generated.
> 
> I'm not sure to understand what the proper fix here. I am also unable
> to reproduce the warning with the above steps.
> 

I think this warning shows up because of the other errors that are 
present in the build log. I do not think there is anything for you to do 
about this warning.

Cheers,
Nathan

  reply	other threads:[~2021-06-18 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 10:33 [linux-next:master 9419/10007] drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type kernel test robot
2021-06-16 10:33 ` kernel test robot
2021-06-18  7:46 ` Miquel Raynal
2021-06-18  7:46   ` Miquel Raynal
2021-06-18 17:09   ` Nathan Chancellor [this message]
2021-06-18 17:09     ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c5d6e01-1530-acc2-9737-491bda391ddf@kernel.org \
    --to=nathan@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=miquel.raynal@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.