[meghadey-crypto:gcm_vaes 3/3] arch/x86/crypto/aesni-intel_glue.c:813:47: warning: format specifies type 'unsigned long' but the argument has type 'u32' (aka 'unsigned int')
by kbuild test robot
tree: https://github.com/meghadey/crypto gcm_vaes
head: 170448f9b4611af0d2d219a0888173f0ab9b290b
commit: 170448f9b4611af0d2d219a0888173f0ab9b290b [3/3] working
config: x86_64-randconfig-a016-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 170448f9b4611af0d2d219a0888173f0ab9b290b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/x86/crypto/aesni-intel_glue.c:813:47: warning: format specifies type 'unsigned long' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
printk("Megha KeyLength %lx left %lxn", ctx->key_length, left);
~~~ ^~~~~~~~~~~~~~~
%x
1 warning generated.
vim +813 arch/x86/crypto/aesni-intel_glue.c
718
719 static int gcmaes_crypt_by_sg(bool enc, struct aead_request *req,
720 unsigned int assoclen, u8 *hash_subkey,
721 u8 *iv, void *aes_ctx)
722 {
723 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
724 unsigned long auth_tag_len = crypto_aead_authsize(tfm);
725 const struct aesni_gcm_tfm_s *gcm_tfm = aesni_gcm_tfm;
726 struct gcm_context_data data AESNI_ALIGN_ATTR;
727 struct scatter_walk dst_sg_walk = {};
728 unsigned long left = req->cryptlen;
729 unsigned long len, srclen, dstlen;
730 struct scatter_walk assoc_sg_walk;
731 struct scatter_walk src_sg_walk;
732 struct scatterlist src_start[2];
733 struct scatterlist dst_start[2];
734 struct scatterlist *src_sg;
735 struct scatterlist *dst_sg;
736 u8 *src, *dst, *assoc;
737 u8 *assocmem = NULL;
738 u8 authTag[16];
739 int i;
740 struct crypto_aes_ctx *ctx;
741
742 if (!enc)
743 left -= auth_tag_len;
744
745 if (left < AVX_GEN4_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen4)
746 gcm_tfm = &aesni_gcm_tfm_avx_gen2;
747 if (left < AVX_GEN2_OPTSIZE && gcm_tfm == &aesni_gcm_tfm_avx_gen2)
748 gcm_tfm = &aesni_gcm_tfm_sse;
749
750 /* Linearize assoc, if not already linear */
751 if (req->src->length >= assoclen && req->src->length &&
752 (!PageHighMem(sg_page(req->src)) ||
753 req->src->offset + req->src->length <= PAGE_SIZE)) {
754 scatterwalk_start(&assoc_sg_walk, req->src);
755 assoc = scatterwalk_map(&assoc_sg_walk);
756 } else {
757 /* assoc can be any length, so must be on heap */
758 assocmem = kmalloc(assoclen, GFP_ATOMIC);
759 if (unlikely(!assocmem))
760 return -ENOMEM;
761 assoc = assocmem;
762
763 scatterwalk_map_and_copy(assoc, req->src, 0, assoclen, 0);
764 }
765
766 if (left) {
767 src_sg = scatterwalk_ffwd(src_start, req->src, req->assoclen);
768 scatterwalk_start(&src_sg_walk, src_sg);
769 if (req->src != req->dst) {
770 dst_sg = scatterwalk_ffwd(dst_start, req->dst,
771 req->assoclen);
772 scatterwalk_start(&dst_sg_walk, dst_sg);
773 }
774 }
775
776 kernel_fpu_begin();
777 ctx = (struct crypto_aes_ctx*) aes_ctx;
778 memcpy(data.hash_keys , hash_subkey, 16*48);
779 gcm_tfm->init(aes_ctx, &data, iv,
780 hash_subkey, assoc, assoclen);
781 if (req->src != req->dst) {
782 while (left) {
783 src = scatterwalk_map(&src_sg_walk);
784 dst = scatterwalk_map(&dst_sg_walk);
785 srclen = scatterwalk_clamp(&src_sg_walk, left);
786 dstlen = scatterwalk_clamp(&dst_sg_walk, left);
787 len = min(srclen, dstlen);
788 if (len) {
789 if (enc) {
790 gcm_tfm->enc_update(aes_ctx, &data,
791 dst, src, len);
792 } else
793 gcm_tfm->dec_update(aes_ctx, &data,
794 dst, src, len);
795 }
796 left -= len;
797
798 scatterwalk_unmap(src);
799 scatterwalk_unmap(dst);
800 scatterwalk_advance(&src_sg_walk, len);
801 scatterwalk_advance(&dst_sg_walk, len);
802 scatterwalk_done(&src_sg_walk, 0, left);
803 scatterwalk_done(&dst_sg_walk, 1, left);
804 }
805 } else {
806 while (left) {
807 dst = src = scatterwalk_map(&src_sg_walk);
808 len = scatterwalk_clamp(&src_sg_walk, left);
809 if (len) {
810 if (enc) {
811 gcm_tfm->enc_update(aes_ctx, &data,
812 src, src, len);
> 813 printk("Megha KeyLength %lx left %lx\n", ctx->key_length, left);
814 printk("Megha cipher:\n");
815 for(i=0;i<8;i++)
816 printk("%lx ", *(unsigned long*)(src + (i*8)));
817 printk("\n");
818 } else {
819 gcm_tfm->dec_update(aes_ctx, &data,
820 src, src, len);
821 printk("Megha plaintext:\n");
822 for(i=0;i<8;i++)
823 printk("%lx ", *(unsigned long*)(src + (i*8)));
824 printk("\n");
825 }
826 }
827 left -= len;
828 scatterwalk_unmap(src);
829 scatterwalk_advance(&src_sg_walk, len);
830 scatterwalk_done(&src_sg_walk, 1, left);
831 }
832 }
833 gcm_tfm->finalize(aes_ctx, &data, authTag, auth_tag_len);
834 printk("Megha tag:\n");
835 for(i=0;i<2;i++)
836 printk("%lx ", *(unsigned long*)(authTag + (i*8)));
837 printk("\n");
838 kernel_fpu_end();
839
840 if (!assocmem)
841 scatterwalk_unmap(assoc);
842 else
843 kfree(assocmem);
844
845 if (!enc) {
846 u8 authTagMsg[16];
847
848 /* Copy out original authTag */
849 scatterwalk_map_and_copy(authTagMsg, req->src,
850 req->assoclen + req->cryptlen -
851 auth_tag_len,
852 auth_tag_len, 0);
853
854 /* Compare generated tag with passed in tag. */
855 return crypto_memneq(authTagMsg, authTag, auth_tag_len) ?
856 -EBADMSG : 0;
857 }
858
859 /* Copy in the authTag */
860 scatterwalk_map_and_copy(authTag, req->dst,
861 req->assoclen + req->cryptlen,
862 auth_tag_len, 1);
863
864 return 0;
865 }
866
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
drivers/clk/clk-stm32f4.c:871:6: note: in expansion of macro 'GENMASK_ULL'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 642b151f45dd54809ea00ecd3976a56c1ec9b53d
commit: 295bcca84916cb5079140a89fccb472bb8d1f6e2 linux/bits.h: add compile time sanity check of GENMASK inputs
date: 6 weeks ago
config: arm-randconfig-r016-20200519 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 295bcca84916cb5079140a89fccb472bb8d1f6e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/of.h:15,
from include/linux/clk-provider.h:9,
from drivers/clk/clk-stm32f4.c:8:
drivers/clk/clk-stm32f4.c: In function 'stm32f4_rcc_lookup_clk_idx':
include/linux/bits.h:26:28: warning: comparison is always false due to limited range of data type [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:45:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
45 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
| ^~~~~~~~~~~~~~~~~~~
>> drivers/clk/clk-stm32f4.c:871:6: note: in expansion of macro 'GENMASK_ULL'
871 | GENMASK_ULL(secondary % BITS_PER_LONG_LONG, 0);
| ^~~~~~~~~~~
include/linux/bits.h:26:40: warning: comparison is always false due to limited range of data type [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:45:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
45 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
| ^~~~~~~~~~~~~~~~~~~
>> drivers/clk/clk-stm32f4.c:871:6: note: in expansion of macro 'GENMASK_ULL'
871 | GENMASK_ULL(secondary % BITS_PER_LONG_LONG, 0);
| ^~~~~~~~~~~
--
In file included from include/linux/bits.h:23,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/mfd/syscon/atmel-smc.h:14,
from drivers/mfd/atmel-smc.c:11:
drivers/mfd/atmel-smc.c: In function 'atmel_smc_cs_encode_ncycles':
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
>> drivers/mfd/atmel-smc.c:49:25: note: in expansion of macro 'GENMASK'
49 | unsigned int lsbmask = GENMASK(msbpos - 1, 0);
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
>> drivers/mfd/atmel-smc.c:49:25: note: in expansion of macro 'GENMASK'
49 | unsigned int lsbmask = GENMASK(msbpos - 1, 0);
| ^~~~~~~
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/mfd/atmel-smc.c:50:25: note: in expansion of macro 'GENMASK'
50 | unsigned int msbmask = GENMASK(msbwidth - 1, 0);
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
| ^
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/mfd/atmel-smc.c:50:25: note: in expansion of macro 'GENMASK'
50 | unsigned int msbmask = GENMASK(msbwidth - 1, 0);
| ^~~~~~~
--
In file included from include/linux/byteorder/little_endian.h:5,
from arch/arm/include/uapi/asm/byteorder.h:22,
from include/asm-generic/bitops/le.h:6,
from arch/arm/include/asm/bitops.h:268,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/clk.h:13,
from drivers/crypto/inside-secure/safexcel.c:8:
drivers/crypto/inside-secure/safexcel.c: In function 'safexcel_hw_init':
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:648:4: note: in expansion of macro 'writel'
648 | writel(EIP197_HIA_RA_PE_CTRL_EN |
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:649:11: note: in expansion of macro 'GENMASK'
649 | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:648:4: note: in expansion of macro 'writel'
648 | writel(EIP197_HIA_RA_PE_CTRL_EN |
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:649:11: note: in expansion of macro 'GENMASK'
649 | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:757:3: note: in expansion of macro 'writel'
757 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:757:35: note: in expansion of macro 'GENMASK'
757 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:757:3: note: in expansion of macro 'writel'
757 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:757:35: note: in expansion of macro 'GENMASK'
757 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:761:3: note: in expansion of macro 'writel'
761 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:761:35: note: in expansion of macro 'GENMASK'
761 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
26 | __builtin_constant_p((l) > (h)), (l) > (h), 0)))
| ^
include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32'
33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
| ^
>> arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
307 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
| ^~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:761:3: note: in expansion of macro 'writel'
761 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( | ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/safexcel.c:761:35: note: in expansion of macro 'GENMASK'
761 | writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
| ^~~~~~~
vim +/GENMASK_ULL +871 drivers/clk/clk-stm32f4.c
358bdf892f6bfa Daniel Thompson 2015-06-10 846
358bdf892f6bfa Daniel Thompson 2015-06-10 847 /*
358bdf892f6bfa Daniel Thompson 2015-06-10 848 * Converts the primary and secondary indices (as they appear in DT) to an
358bdf892f6bfa Daniel Thompson 2015-06-10 849 * offset into our struct clock array.
358bdf892f6bfa Daniel Thompson 2015-06-10 850 */
358bdf892f6bfa Daniel Thompson 2015-06-10 851 static int stm32f4_rcc_lookup_clk_idx(u8 primary, u8 secondary)
358bdf892f6bfa Daniel Thompson 2015-06-10 852 {
a064a07f72e92c Gabriel Fernandez 2016-10-21 853 u64 table[MAX_GATE_MAP];
358bdf892f6bfa Daniel Thompson 2015-06-10 854
358bdf892f6bfa Daniel Thompson 2015-06-10 855 if (primary == 1) {
88c9b70bb2b218 Gabriel Fernandez 2017-01-06 856 if (WARN_ON(secondary >= stm32fx_end_primary_clk))
358bdf892f6bfa Daniel Thompson 2015-06-10 857 return -EINVAL;
358bdf892f6bfa Daniel Thompson 2015-06-10 858 return secondary;
358bdf892f6bfa Daniel Thompson 2015-06-10 859 }
358bdf892f6bfa Daniel Thompson 2015-06-10 860
a064a07f72e92c Gabriel Fernandez 2016-10-21 861 memcpy(table, stm32f4_gate_map, sizeof(table));
358bdf892f6bfa Daniel Thompson 2015-06-10 862
358bdf892f6bfa Daniel Thompson 2015-06-10 863 /* only bits set in table can be used as indices */
15ab38273d21a4 Daniel Thompson 2015-06-28 864 if (WARN_ON(secondary >= BITS_PER_BYTE * sizeof(table) ||
358bdf892f6bfa Daniel Thompson 2015-06-10 865 0 == (table[BIT_ULL_WORD(secondary)] &
358bdf892f6bfa Daniel Thompson 2015-06-10 866 BIT_ULL_MASK(secondary))))
358bdf892f6bfa Daniel Thompson 2015-06-10 867 return -EINVAL;
358bdf892f6bfa Daniel Thompson 2015-06-10 868
358bdf892f6bfa Daniel Thompson 2015-06-10 869 /* mask out bits above our current index */
358bdf892f6bfa Daniel Thompson 2015-06-10 870 table[BIT_ULL_WORD(secondary)] &=
358bdf892f6bfa Daniel Thompson 2015-06-10 @871 GENMASK_ULL(secondary % BITS_PER_LONG_LONG, 0);
358bdf892f6bfa Daniel Thompson 2015-06-10 872
88c9b70bb2b218 Gabriel Fernandez 2017-01-06 873 return stm32fx_end_primary_clk - 1 + hweight64(table[0]) +
358bdf892f6bfa Daniel Thompson 2015-06-10 874 (BIT_ULL_WORD(secondary) >= 1 ? hweight64(table[1]) : 0) +
358bdf892f6bfa Daniel Thompson 2015-06-10 875 (BIT_ULL_WORD(secondary) >= 2 ? hweight64(table[2]) : 0);
358bdf892f6bfa Daniel Thompson 2015-06-10 876 }
358bdf892f6bfa Daniel Thompson 2015-06-10 877
:::::: The code at line 871 was first introduced by commit
:::::: 358bdf892f6bfacf20884b54a35ab038321f06f9 clk: stm32: Add clock driver for STM32F4[23]xxx devices
:::::: TO: Daniel Thompson <daniel.thompson(a)linaro.org>
:::::: CC: Stephen Boyd <sboyd(a)codeaurora.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[nvdimm:libnvdimm-pending 284/291] arch/powerpc/include/asm/uaccess.h:336:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head: 4e2f899e682d1e6c647651bc36bcdba3b3577485
commit: 0b25105d34e381fafc7eb9395007727bbb4661a4 [284/291] x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user,kernel}()
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 0b25105d34e381fafc7eb9395007727bbb4661a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/uaccess.h:11,
from include/linux/crypto.h:21,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/powerpc/kernel/asm-offsets.c:14:
>> arch/powerpc/include/asm/uaccess.h:332:1: warning: no previous prototype for 'copy_mc_generic' [-Wmissing-prototypes]
332 | copy_mc_generic(void *to, const void *from, unsigned long size)
| ^~~~~~~~~~~~~~~
arch/powerpc/include/asm/uaccess.h: In function 'copy_mc_generic':
>> arch/powerpc/include/asm/uaccess.h:336:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
336 | {
| ^
arch/powerpc/include/asm/uaccess.h:343:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
343 | {
| ^
arch/powerpc/include/asm/uaccess.h:359:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
359 | {
| ^
arch/powerpc/include/asm/uaccess.h:372:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
372 | {
| ^
arch/powerpc/include/asm/uaccess.h:408:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
408 | {
| ^
arch/powerpc/include/asm/uaccess.h:435:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
435 | {
| ^
arch/powerpc/include/asm/uaccess.h:447:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
447 | {
| ^
arch/powerpc/include/asm/uaccess.h:459:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
459 | {
| ^
>> arch/powerpc/include/asm/uaccess.h:463:13: error: storage class specified for parameter 'strncpy_from_user'
463 | extern long strncpy_from_user(char *dst, const char __user *src, long count);
| ^~~~~~~~~~~~~~~~~
>> arch/powerpc/include/asm/uaccess.h:464:26: error: storage class specified for parameter 'strnlen_user'
464 | extern __must_check long strnlen_user(const char __user *str, long n);
| ^~~~~~~~~~~~
>> arch/powerpc/include/asm/uaccess.h:466:13: error: storage class specified for parameter '__copy_from_user_flushcache'
466 | extern long __copy_from_user_flushcache(void *dst, const void __user *src,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/powerpc/include/asm/uaccess.h:468:13: error: storage class specified for parameter 'memcpy_page_flushcache'
468 | extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
| ^~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/uaccess.h:472:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
472 | {
| ^
In file included from include/linux/crypto.h:21,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/powerpc/kernel/asm-offsets.c:14:
>> include/linux/uaccess.h:60:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
60 | {
| ^
include/linux/uaccess.h:68:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
68 | {
| ^
include/linux/uaccess.h:90:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
90 | {
| ^
include/linux/uaccess.h:98:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
98 | {
| ^
>> include/linux/uaccess.h:121:1: error: storage class specified for parameter '_copy_from_user'
121 | _copy_from_user(void *, const void __user *, unsigned long);
| ^~~~~~~~~~~~~~~
>> include/linux/uaccess.h:137:1: error: storage class specified for parameter '_copy_to_user'
137 | _copy_to_user(void __user *, const void *, unsigned long);
| ^~~~~~~~~~~~~
include/linux/uaccess.h:142:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
142 | {
| ^
include/linux/uaccess.h:150:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
150 | {
| ^
include/linux/uaccess.h:158:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
158 | {
| ^
include/linux/uaccess.h:176:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
176 | {
| ^
include/linux/uaccess.h:181:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
181 | {
| ^
include/linux/uaccess.h:193:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
193 | {
| ^
include/linux/uaccess.h:203:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
203 | {
| ^
include/linux/uaccess.h:216:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
216 | {
| ^
include/linux/uaccess.h:237:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
237 | {
| ^
>> include/linux/uaccess.h:243:25: error: storage class specified for parameter 'check_zeroed_user'
243 | extern __must_check int check_zeroed_user(const void __user *from, size_t size);
| ^~~~~~~~~~~~~~~~~
include/linux/uaccess.h:295:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
295 | {
| ^
>> include/linux/uaccess.h:322:13: error: storage class specified for parameter 'probe_kernel_read'
322 | extern long probe_kernel_read(void *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~
>> include/linux/uaccess.h:323:13: error: storage class specified for parameter 'probe_kernel_read_strict'
323 | extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/uaccess.h:324:13: error: storage class specified for parameter '__probe_kernel_read'
324 | extern long __probe_kernel_read(void *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/uaccess.h:335:13: error: storage class specified for parameter 'probe_user_read'
335 | extern long probe_user_read(void *dst, const void __user *src, size_t size);
| ^~~~~~~~~~~~~~~
>> include/linux/uaccess.h:336:13: error: storage class specified for parameter '__probe_user_read'
336 | extern long __probe_user_read(void *dst, const void __user *src, size_t size);
| ^~~~~~~~~~~~~~~~~
>> include/linux/uaccess.h:347:21: error: storage class specified for parameter 'probe_kernel_write'
347 | extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~~
>> include/linux/uaccess.h:347:21: error: 'no_instrument_function' attribute applies only to functions
>> include/linux/uaccess.h:348:21: error: storage class specified for parameter '__probe_kernel_write'
348 | extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:348:21: error: 'no_instrument_function' attribute applies only to functions
>> include/linux/uaccess.h:359:21: error: storage class specified for parameter 'probe_user_write'
359 | extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~
include/linux/uaccess.h:359:21: error: 'no_instrument_function' attribute applies only to functions
>> include/linux/uaccess.h:360:21: error: storage class specified for parameter '__probe_user_write'
360 | extern long notrace __probe_user_write(void __user *dst, const void *src, size_t size);
| ^~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:360:21: error: 'no_instrument_function' attribute applies only to functions
include/linux/uaccess.h:362:13: error: storage class specified for parameter 'strncpy_from_unsafe'
362 | extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
| ^~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:363:13: error: storage class specified for parameter 'strncpy_from_unsafe_strict'
363 | extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:365:13: error: storage class specified for parameter '__strncpy_from_unsafe'
365 | extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:366:13: error: storage class specified for parameter 'strncpy_from_unsafe_user'
366 | extern long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:368:13: error: storage class specified for parameter 'strnlen_unsafe_user'
368 | extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
| ^~~~~~~~~~~~~~~~~~~
In file included from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/powerpc/kernel/asm-offsets.c:14:
include/linux/crypto.h:131:1: warning: empty declaration
131 | struct scatterlist;
| ^~~~~~
include/linux/crypto.h:132:1: warning: empty declaration
132 | struct crypto_async_request;
| ^~~~~~
include/linux/crypto.h:133:1: warning: empty declaration
133 | struct crypto_tfm;
| ^~~~~~
include/linux/crypto.h:134:1: warning: empty declaration
134 | struct crypto_type;
| ^~~~~~
include/linux/crypto.h:136:16: error: storage class specified for parameter 'crypto_completion_t'
136 | typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
| ^~~~~~~~~~~~~~~~~~~
include/linux/crypto.h:147:2: error: expected specifier-qualifier-list before 'crypto_completion_t'
147 | crypto_completion_t complete;
| ^~~~~~~~~~~~~~~~~~~
include/linux/crypto.h:145:1: warning: empty declaration
145 | struct crypto_async_request {
| ^~~~~~
include/linux/crypto.h:208:1: warning: empty declaration
208 | struct cipher_alg {
| ^~~~~~
include/linux/crypto.h:228:1: warning: empty declaration
228 | struct compress_alg {
| ^~~~~~
include/linux/crypto.h:435:1: warning: empty declaration
435 | struct crypto_alg {
| ^~~~~~
include/linux/crypto.h:499:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
499 | {}
| ^
include/linux/crypto.h:501:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
501 | {}
| ^
include/linux/crypto.h:503:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
503 | {}
| ^
include/linux/crypto.h:505:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
505 | {}
| ^
include/linux/crypto.h:507:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
507 | {}
| ^
include/linux/crypto.h:509:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
509 | {}
| ^
include/linux/crypto.h:511:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
511 | {}
| ^
include/linux/crypto.h:513:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
513 | {}
| ^
include/linux/crypto.h:515:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
515 | {}
| ^
include/linux/crypto.h:517:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
517 | {}
| ^
include/linux/crypto.h:519:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
519 | {}
| ^
include/linux/crypto.h:521:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
521 | {}
| ^
include/linux/crypto.h:523:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
523 | {}
| ^
include/linux/crypto.h:525:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
525 | {}
| ^
include/linux/crypto.h:527:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
527 | {}
| ^
include/linux/crypto.h:529:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
529 | {}
vim +336 arch/powerpc/include/asm/uaccess.h
326
327 extern unsigned long __copy_tofrom_user(void __user *to,
328 const void __user *from, unsigned long size);
329
330 #ifdef CONFIG_ARCH_HAS_COPY_MC
331 extern unsigned long __must_check
> 332 copy_mc_generic(void *to, const void *from, unsigned long size)
333
334 static __always_inline unsigned long __must_check
335 copy_mc_to_kernel(void *to, const void *from, unsigned long size)
> 336 {
337 return copy_mc_generic(to, from, size);
338 }
339 #define copy_mc_to_kernel copy_mc_to_kernel
340
341 static __always_inline unsigned long __must_check
342 copy_mc_to_user(void __user *to, const void *from, unsigned long n)
343 {
344 if (likely(check_copy_size(from, n, true))) {
345 if (access_ok(to, n)) {
346 allow_write_to_user(to, n);
347 n = copy_mc_generic((void *)to, from, n);
348 prevent_write_to_user(to, n);
349 }
350 }
351
352 return n;
353 }
354 #endif
355
356 #ifdef __powerpc64__
357 static inline unsigned long
358 raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
359 {
360 unsigned long ret;
361
362 barrier_nospec();
363 allow_read_write_user(to, from, n);
364 ret = __copy_tofrom_user(to, from, n);
365 prevent_read_write_user(to, from, n);
366 return ret;
367 }
368 #endif /* __powerpc64__ */
369
370 static inline unsigned long raw_copy_from_user(void *to,
371 const void __user *from, unsigned long n)
372 {
373 unsigned long ret;
374 if (__builtin_constant_p(n) && (n <= 8)) {
375 ret = 1;
376
377 switch (n) {
378 case 1:
379 barrier_nospec();
380 __get_user_size(*(u8 *)to, from, 1, ret);
381 break;
382 case 2:
383 barrier_nospec();
384 __get_user_size(*(u16 *)to, from, 2, ret);
385 break;
386 case 4:
387 barrier_nospec();
388 __get_user_size(*(u32 *)to, from, 4, ret);
389 break;
390 case 8:
391 barrier_nospec();
392 __get_user_size(*(u64 *)to, from, 8, ret);
393 break;
394 }
395 if (ret == 0)
396 return 0;
397 }
398
399 barrier_nospec();
400 allow_read_from_user(from, n);
401 ret = __copy_tofrom_user((__force void __user *)to, from, n);
402 prevent_read_from_user(from, n);
403 return ret;
404 }
405
406 static inline unsigned long
407 raw_copy_to_user_allowed(void __user *to, const void *from, unsigned long n)
408 {
409 if (__builtin_constant_p(n) && (n <= 8)) {
410 unsigned long ret = 1;
411
412 switch (n) {
413 case 1:
414 __put_user_size_allowed(*(u8 *)from, (u8 __user *)to, 1, ret);
415 break;
416 case 2:
417 __put_user_size_allowed(*(u16 *)from, (u16 __user *)to, 2, ret);
418 break;
419 case 4:
420 __put_user_size_allowed(*(u32 *)from, (u32 __user *)to, 4, ret);
421 break;
422 case 8:
423 __put_user_size_allowed(*(u64 *)from, (u64 __user *)to, 8, ret);
424 break;
425 }
426 if (ret == 0)
427 return 0;
428 }
429
430 return __copy_tofrom_user(to, (__force const void __user *)from, n);
431 }
432
433 static inline unsigned long
434 raw_copy_to_user(void __user *to, const void *from, unsigned long n)
435 {
436 unsigned long ret;
437
438 allow_write_to_user(to, n);
439 ret = raw_copy_to_user_allowed(to, from, n);
440 prevent_write_to_user(to, n);
441 return ret;
442 }
443
444 unsigned long __arch_clear_user(void __user *addr, unsigned long size);
445
446 static inline unsigned long clear_user(void __user *addr, unsigned long size)
447 {
448 unsigned long ret = size;
449 might_fault();
450 if (likely(access_ok(addr, size))) {
451 allow_write_to_user(addr, size);
452 ret = __arch_clear_user(addr, size);
453 prevent_write_to_user(addr, size);
454 }
455 return ret;
456 }
457
458 static inline unsigned long __clear_user(void __user *addr, unsigned long size)
459 {
460 return clear_user(addr, size);
461 }
462
> 463 extern long strncpy_from_user(char *dst, const char __user *src, long count);
> 464 extern __must_check long strnlen_user(const char __user *str, long n);
465
> 466 extern long __copy_from_user_flushcache(void *dst, const void __user *src,
467 unsigned size);
> 468 extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
469 size_t len);
470
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[nvdimm:libnvdimm-pending 286/291] drivers/acpi/osl.c:769:14: warning: variable 'status' set but not used
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head: 4e2f899e682d1e6c647651bc36bcdba3b3577485
commit: ff99d8c56c8e8d60122b87333e3b807fd1638431 [286/291] ACPI: Drop rcu usage for MMIO mappings
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout ff99d8c56c8e8d60122b87333e3b807fd1638431
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/acpi/osl.c: In function 'acpi_os_vprintf':
drivers/acpi/osl.c:151:2: warning: function 'acpi_os_vprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
vsprintf(buffer, fmt, args);
^~~~~~~~
drivers/acpi/osl.c: In function 'acpi_os_write_memory':
>> drivers/acpi/osl.c:769:14: warning: variable 'status' set but not used [-Wunused-but-set-variable]
acpi_status status;
^~~~~~
vim +/status +769 drivers/acpi/osl.c
d2b7355684cdcf Dan Williams 2020-05-13 764
e615bf5b551986 Myron Stowe 2012-01-20 765 acpi_status
653f4b538f66d3 Bob Moore 2012-02-14 766 acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width)
e615bf5b551986 Myron Stowe 2012-01-20 767 {
e615bf5b551986 Myron Stowe 2012-01-20 768 unsigned int size = width / 8;
d2b7355684cdcf Dan Williams 2020-05-13 @769 acpi_status status;
ff99d8c56c8e8d Dan Williams 2020-04-27 770 bool did_fallback = false;
ff99d8c56c8e8d Dan Williams 2020-04-27 771 void __iomem *virt_addr;
e615bf5b551986 Myron Stowe 2012-01-20 772
ff99d8c56c8e8d Dan Williams 2020-04-27 773 virt_addr = acpi_os_rw_map(phys_addr, size, &did_fallback);
e615bf5b551986 Myron Stowe 2012-01-20 774 if (!virt_addr)
e615bf5b551986 Myron Stowe 2012-01-20 775 return AE_BAD_ADDRESS;
e615bf5b551986 Myron Stowe 2012-01-20 776
d2b7355684cdcf Dan Williams 2020-05-13 777 status = acpi_os_write_iomem(virt_addr, value, width);
e615bf5b551986 Myron Stowe 2012-01-20 778
ff99d8c56c8e8d Dan Williams 2020-04-27 779 acpi_os_rw_unmap(virt_addr, did_fallback);
ff99d8c56c8e8d Dan Williams 2020-04-27 780 return AE_OK;
e615bf5b551986 Myron Stowe 2012-01-20 781 }
e615bf5b551986 Myron Stowe 2012-01-20 782
:::::: The code at line 769 was first introduced by commit
:::::: d2b7355684cdcf842a9853915ae1c4927ae9a80a ACPI: Store pre-mapped registers in APEI entries
:::::: TO: Dan Williams <dan.j.williams(a)intel.com>
:::::: CC: Dan Williams <dan.j.williams(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[gabbayo:habanalabs-next 35/38] drivers/misc/habanalabs/gaudi/gaudi_coresight.c:833:6: warning: variable 'val' set but not used
by kbuild test robot
tree: git://people.freedesktop.org/~gabbayo/linux habanalabs-next
head: addd4be0a770e4cf5607310459cb7c8d11c8ae57
commit: af3bef8b2782bfe3eeb32c8f1f264b5064a27f81 [35/38] habanalabs: add gaudi profiler module
config: m68k-randconfig-r012-20200519 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout af3bef8b2782bfe3eeb32c8f1f264b5064a27f81
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/misc/habanalabs/gaudi/gaudi_coresight.c: In function 'gaudi_debug_coresight':
>> drivers/misc/habanalabs/gaudi/gaudi_coresight.c:833:6: warning: variable 'val' set but not used [-Wunused-but-set-variable]
833 | u32 val;
| ^~~
vim +/val +833 drivers/misc/habanalabs/gaudi/gaudi_coresight.c
829
830 int gaudi_debug_coresight(struct hl_device *hdev, void *data)
831 {
832 struct hl_debug_params *params = data;
> 833 u32 val;
834 int rc = 0;
835
836 switch (params->op) {
837 case HL_DEBUG_OP_STM:
838 rc = gaudi_config_stm(hdev, params);
839 break;
840 case HL_DEBUG_OP_ETF:
841 rc = gaudi_config_etf(hdev, params);
842 break;
843 case HL_DEBUG_OP_ETR:
844 rc = gaudi_config_etr(hdev, params);
845 break;
846 case HL_DEBUG_OP_FUNNEL:
847 rc = gaudi_config_funnel(hdev, params);
848 break;
849 case HL_DEBUG_OP_BMON:
850 rc = gaudi_config_bmon(hdev, params);
851 break;
852 case HL_DEBUG_OP_SPMU:
853 rc = gaudi_config_spmu(hdev, params);
854 break;
855 case HL_DEBUG_OP_TIMESTAMP:
856 /* Do nothing as this opcode is deprecated */
857 break;
858
859 default:
860 dev_err(hdev->dev, "Unknown coresight id %d\n", params->op);
861 return -EINVAL;
862 }
863
864 /* Perform read from the device to flush all configuration */
865 val = RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
866
867 return rc;
868 }
869
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[nvdimm:libnvdimm-pending 284/291] include/linux/fs.h:908:29: error: storage class specified for parameter 'I_BDEV'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head: 4e2f899e682d1e6c647651bc36bcdba3b3577485
commit: 0b25105d34e381fafc7eb9395007727bbb4661a4 [284/291] x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user,kernel}()
config: powerpc-rhel-kconfig (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 0b25105d34e381fafc7eb9395007727bbb4661a4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
| ^
include/linux/fs.h:540:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
540 | {
| ^
include/linux/fs.h:545:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
545 | {
| ^
include/linux/fs.h:553:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
553 | {
| ^
include/linux/fs.h:567:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
567 | {
| ^
include/linux/fs.h:572:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
572 | {
| ^
include/linux/fs.h:578:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
578 | {
| ^
include/linux/fs.h:583:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
583 | {
| ^
include/linux/fs.h:589:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
589 | {
| ^
include/linux/fs.h:604:1: warning: empty declaration
604 | struct posix_acl;
| ^~~~~~
include/linux/fs.h:610:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
610 | {
| ^
include/linux/fs.h:616:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
616 | {
| ^
include/linux/fs.h:626:1: warning: empty declaration
626 | struct fsnotify_mark_connector;
| ^~~~~~
include/linux/fs.h:668:20: error: field 'i_atime' has incomplete type
668 | struct timespec64 i_atime;
| ^~~~~~~
include/linux/fs.h:669:20: error: field 'i_mtime' has incomplete type
669 | struct timespec64 i_mtime;
| ^~~~~~~
include/linux/fs.h:670:20: error: field 'i_ctime' has incomplete type
670 | struct timespec64 i_ctime;
| ^~~~~~~
include/linux/fs.h:633:1: warning: empty declaration
633 | struct inode {
| ^~~~~~
include/linux/fs.h:749:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
749 | {
| ^
include/linux/fs.h:754:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
754 | {
| ^
include/linux/fs.h:765:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
765 | {
| ^
include/linux/fs.h:785:1: warning: empty declaration
785 | enum inode_i_mutex_lock_class
| ^~~~
include/linux/fs.h:796:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
796 | {
| ^
include/linux/fs.h:801:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
801 | {
| ^
include/linux/fs.h:806:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
806 | {
| ^
include/linux/fs.h:811:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
811 | {
| ^
include/linux/fs.h:816:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
816 | {
| ^
include/linux/fs.h:821:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
821 | {
| ^
include/linux/fs.h:826:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
826 | {
| ^
include/linux/fs.h:831:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
831 | {
| ^
include/linux/fs.h:836:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
836 | {
| ^
include/linux/fs.h:854:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
854 | {
| ^
include/linux/fs.h:882:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
882 | {
| ^
include/linux/fs.h:899:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
899 | {
| ^
include/linux/fs.h:904:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
904 | {
| ^
>> include/linux/fs.h:908:29: error: storage class specified for parameter 'I_BDEV'
908 | extern struct block_device *I_BDEV(struct inode *inode);
| ^~~~~~
>> include/linux/fs.h:913:16: error: field 'pid_type' has incomplete type
913 | enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */
| ^~~~~~~~
include/linux/fs.h:910:1: warning: empty declaration
910 | struct fown_struct {
| ^~~~~~
include/linux/fs.h:921:1: warning: empty declaration
921 | struct file_ra_state {
| ^~~~~~
include/linux/fs.h:936:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
936 | {
| ^
include/linux/fs.h:978:2: error: expected specifier-qualifier-list before 'errseq_t'
978 | errseq_t f_wb_err;
| ^~~~~~~~
include/linux/fs.h:941:1: warning: empty declaration
941 | struct file {
| ^~~~~~
include/linux/fs.h:982:1: warning: empty declaration
982 | struct file_handle {
| ^~~~~~
include/linux/fs.h:990:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
990 | {
| ^
>> include/linux/fs.h:1031:15: error: storage class specified for parameter 'fl_owner_t'
1031 | typedef void *fl_owner_t;
| ^~~~~~~~~~
include/linux/fs.h:1033:1: warning: empty declaration
1033 | struct file_lock;
| ^~~~~~
include/linux/fs.h:1035:1: warning: empty declaration
1035 | struct file_lock_operations {
| ^~~~~~
>> include/linux/fs.h:1041:2: error: expected specifier-qualifier-list before 'fl_owner_t'
1041 | fl_owner_t (*lm_get_owner)(fl_owner_t);
| ^~~~~~~~~~
include/linux/fs.h:1040:1: warning: empty declaration
1040 | struct lock_manager_operations {
| ^~~~~~
include/linux/fs.h:1050:1: warning: empty declaration
1050 | struct lock_manager {
| ^~~~~~
include/linux/fs.h:1059:1: warning: empty declaration
1059 | struct net;
| ^~~~~~
In file included from include/linux/fs.h:1066,
from include/linux/compat.h:17,
from arch/powerpc/kernel/asm-offsets.c:14:
include/linux/nfs_fs_i.h:5:1: warning: empty declaration
5 | struct nlm_lockowner;
| ^~~~~~
include/linux/nfs_fs_i.h:10:1: warning: empty declaration
10 | struct nfs_lock_info {
| ^~~~~~
include/linux/nfs_fs_i.h:16:1: warning: empty declaration
16 | struct nfs4_lock_state;
| ^~~~~~
include/linux/nfs_fs_i.h:17:1: warning: empty declaration
17 | struct nfs4_lock_info {
| ^~~~~~
In file included from include/linux/compat.h:17,
from arch/powerpc/kernel/asm-offsets.c:14:
include/linux/fs.h:1095:2: error: expected specifier-qualifier-list before 'fl_owner_t'
1095 | fl_owner_t fl_owner;
| ^~~~~~~~~~
include/linux/fs.h:1085:1: warning: empty declaration
1085 | struct file_lock {
| ^~~~~~
include/linux/fs.h:1123:1: warning: empty declaration
1123 | struct file_lock_context {
| ^~~~~~
>> include/linux/fs.h:1137:13: error: storage class specified for parameter 'send_sigio'
1137 | extern void send_sigio(struct fown_struct *fown, int fd, int band);
| ^~~~~~~~~~
>> include/linux/fs.h:1142:12: error: storage class specified for parameter 'fcntl_getlk'
1142 | extern int fcntl_getlk(struct file *, unsigned int, struct flock *);
| ^~~~~~~~~~~
>> include/linux/fs.h:1143:12: error: storage class specified for parameter 'fcntl_setlk'
1143 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
| ^~~~~~~~~~~
>> include/linux/fs.h:1152:12: error: storage class specified for parameter 'fcntl_setlease'
1152 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
| ^~~~~~~~~~~~~~
>> include/linux/fs.h:1153:12: error: storage class specified for parameter 'fcntl_getlease'
1153 | extern int fcntl_getlease(struct file *filp);
| ^~~~~~~~~~~~~~
>> include/linux/fs.h:1158:13: error: storage class specified for parameter 'locks_init_lock'
1158 | extern void locks_init_lock(struct file_lock *);
| ^~~~~~~~~~~~~~~
>> include/linux/fs.h:1159:27: error: storage class specified for parameter 'locks_alloc_lock'
1159 | extern struct file_lock * locks_alloc_lock(void);
| ^~~~~~~~~~~~~~~~
>> include/linux/fs.h:1160:13: error: storage class specified for parameter 'locks_copy_lock'
1160 | extern void locks_copy_lock(struct file_lock *, struct file_lock *);
| ^~~~~~~~~~~~~~~
>> include/linux/fs.h:1161:13: error: storage class specified for parameter 'locks_copy_conflock'
1161 | extern void locks_copy_conflock(struct file_lock *, struct file_lock *);
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/fs.h:1162:47: error: expected declaration specifiers or '...' before 'fl_owner_t'
1162 | extern void locks_remove_posix(struct file *, fl_owner_t);
| ^~~~~~~~~~
>> include/linux/fs.h:1163:13: error: storage class specified for parameter 'locks_remove_file'
1163 | extern void locks_remove_file(struct file *);
| ^~~~~~~~~~~~~~~~~
>> include/linux/fs.h:1164:13: error: storage class specified for parameter 'locks_release_private'
1164 | extern void locks_release_private(struct file_lock *);
| ^~~~~~~~~~~~~~~~~~~~~
>> include/linux/fs.h:1165:13: error: storage class specified for parameter 'posix_test_lock'
1165 | extern void posix_test_lock(struct file *, struct file_lock *);
| ^~~~~~~~~~~~~~~
>> include/linux/fs.h:1166:12: error: storage class specified for parameter 'posix_lock_file'
1166 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
| ^~~~~~~~~~~~~~~
>> include/linux/fs.h:1167:12: error: storage class specified for parameter 'locks_delete_block'
1167 | extern int locks_delete_block(struct file_lock *);
| ^~~~~~~~~~~~~~~~~~
>> include/linux/fs.h:1168:12: error: storage class specified for parameter 'vfs_test_lock'
1168 | extern int vfs_test_lock(struct file *, struct file_lock *);
| ^~~~~~~~~~~~~
include/linux/fs.h:1169:12: error: storage class specified for parameter 'vfs_lock_file'
1169 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
| ^~~~~~~~~~~~~
include/linux/fs.h:1170:12: error: storage class specified for parameter 'vfs_cancel_lock'
1170 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
| ^~~~~~~~~~~~~~~
include/linux/fs.h:1171:12: error: storage class specified for parameter 'locks_lock_inode_wait'
1171 | extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/fs.h:1172:12: error: storage class specified for parameter '__break_lease'
1172 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
| ^~~~~~~~~~~~~
include/linux/fs.h:1173:13: error: storage class specified for parameter 'lease_get_mtime'
1173 | extern void lease_get_mtime(struct inode *, struct timespec64 *time);
| ^~~~~~~~~~~~~~~
include/linux/fs.h:1174:12: error: storage class specified for parameter 'generic_setlease'
1174 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
| ^~~~~~~~~~~~~~~~
include/linux/fs.h:1175:12: error: storage class specified for parameter 'vfs_setlease'
1175 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
| ^~~~~~~~~~~~
include/linux/fs.h:1176:12: error: storage class specified for parameter 'lease_modify'
1176 | extern int lease_modify(struct file_lock *, int, struct list_head *);
| ^~~~~~~~~~~~
include/linux/fs.h:1178:1: warning: empty declaration
1178 | struct notifier_block;
| ^~~~~~
include/linux/fs.h:1179:12: error: storage class specified for parameter 'lease_register_notifier'
1179 | extern int lease_register_notifier(struct notifier_block *);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/fs.h:1180:13: error: storage class specified for parameter 'lease_unregister_notifier'
1180 | extern void lease_unregister_notifier(struct notifier_block *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/fs.h:1182:1: warning: empty declaration
1182 | struct files_struct;
| ^~~~~~
include/linux/fs.h:1183:13: error: storage class specified for parameter 'show_fd_locks'
1183 | extern void show_fd_locks(struct seq_file *f,
| ^~~~~~~~~~~~~
include/linux/fs.h:1323:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1323 | {
| ^
include/linux/fs.h:1328:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1328 | {
| ^
include/linux/fs.h:1333:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1333 | {
| ^
include/linux/fs.h:1337:1: warning: empty declaration
1337 | struct fasync_struct {
| ^~~~~~
include/linux/fs.h:1349:12: error: storage class specified for parameter 'fasync_helper'
1349 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
| ^~~~~~~~~~~~~
include/linux/fs.h:1350:30: error: storage class specified for parameter 'fasync_insert_entry'
1350 | extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
| ^~~~~~~~~~~~~~~~~~~
include/linux/fs.h:1351:12: error: storage class specified for parameter 'fasync_remove_entry'
1351 | extern int fasync_remove_entry(struct file *, struct fasync_struct **);
| ^~~~~~~~~~~~~~~~~~~
include/linux/fs.h:1352:30: error: storage class specified for parameter 'fasync_alloc'
1352 | extern struct fasync_struct *fasync_alloc(void);
| ^~~~~~~~~~~~
include/linux/fs.h:1353:13: error: storage class specified for parameter 'fasync_free'
1353 | extern void fasync_free(struct fasync_struct *);
| ^~~~~~~~~~~
include/linux/fs.h:1356:13: error: storage class specified for parameter 'kill_fasync'
1356 | extern void kill_fasync(struct fasync_struct **, int, int);
| ^~~~~~~~~~~
include/linux/fs.h:1358:13: error: storage class specified for parameter '__f_setown'
1358 | extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
| ^~~~~~~~~~
include/linux/fs.h:1359:12: error: storage class specified for parameter 'f_setown'
1359 | extern int f_setown(struct file *filp, unsigned long arg, int force);
| ^~~~~~~~
include/linux/fs.h:1360:13: error: storage class specified for parameter 'f_delown'
1360 | extern void f_delown(struct file *filp);
| ^~~~~~~~
include/linux/fs.h:1361:14: error: storage class specified for parameter 'f_getown'
1361 | extern pid_t f_getown(struct file *filp);
| ^~~~~~~~
include/linux/fs.h:1362:12: error: storage class specified for parameter 'send_sigurg'
1362 | extern int send_sigurg(struct fown_struct *fown);
| ^~~~~~~~~~~
include/linux/fs.h:1413:1: warning: empty declaration
1413 | enum {
| ^~~~
include/linux/fs.h:1424:1: warning: empty declaration
1424 | struct sb_writers {
| ^~~~~~
include/linux/fs.h:1488:2: error: expected specifier-qualifier-list before 'uuid_t'
1488 | uuid_t s_uuid; /* UUID */
| ^~~~~~
include/linux/fs.h:1430:1: warning: empty declaration
1430 | struct super_block {
| ^~~~~~
include/linux/fs.h:1565:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1565 | {
vim +/I_BDEV +908 include/linux/fs.h
^1da177e4c3f4152 Linus Torvalds 2005-04-16 875
7762f5a0b709b415 Miklos Szeredi 2006-10-17 876 /*
7762f5a0b709b415 Miklos Szeredi 2006-10-17 877 * NOTE: unlike i_size_read(), i_size_write() does need locking around it
7762f5a0b709b415 Miklos Szeredi 2006-10-17 878 * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount
7762f5a0b709b415 Miklos Szeredi 2006-10-17 879 * can be lost, resulting in subsequent i_size_read() calls spinning forever.
7762f5a0b709b415 Miklos Szeredi 2006-10-17 880 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 881 static inline void i_size_write(struct inode *inode, loff_t i_size)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @882 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 883 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
74e3d1e17b2e11d1 Fan Du 2013-04-30 884 preempt_disable();
^1da177e4c3f4152 Linus Torvalds 2005-04-16 885 write_seqcount_begin(&inode->i_size_seqcount);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 886 inode->i_size = i_size;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 887 write_seqcount_end(&inode->i_size_seqcount);
74e3d1e17b2e11d1 Fan Du 2013-04-30 888 preempt_enable();
2496396fcb44404e Thomas Gleixner 2019-10-15 889 #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPTION)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 890 preempt_disable();
^1da177e4c3f4152 Linus Torvalds 2005-04-16 891 inode->i_size = i_size;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 892 preempt_enable();
^1da177e4c3f4152 Linus Torvalds 2005-04-16 893 #else
^1da177e4c3f4152 Linus Torvalds 2005-04-16 894 inode->i_size = i_size;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 895 #endif
^1da177e4c3f4152 Linus Torvalds 2005-04-16 896 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 897
48ed214d10ae3c39 Jan Engelhardt 2006-12-06 898 static inline unsigned iminor(const struct inode *inode)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @899 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 900 return MINOR(inode->i_rdev);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 901 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 902
48ed214d10ae3c39 Jan Engelhardt 2006-12-06 903 static inline unsigned imajor(const struct inode *inode)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 904 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 905 return MAJOR(inode->i_rdev);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 906 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 907
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @908 extern struct block_device *I_BDEV(struct inode *inode);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 909
^1da177e4c3f4152 Linus Torvalds 2005-04-16 910 struct fown_struct {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 911 rwlock_t lock; /* protects pid, uid, euid fields */
609d7fa9565c7544 Eric W. Biederman 2006-10-02 912 struct pid *pid; /* pid or -pgrp where SIGIO should be sent */
609d7fa9565c7544 Eric W. Biederman 2006-10-02 @913 enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */
92361636e0153bd0 Eric W. Biederman 2012-02-08 914 kuid_t uid, euid; /* uid/euid of process setting the owner */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 915 int signum; /* posix.1b rt signal to be delivered on IO */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 916 };
^1da177e4c3f4152 Linus Torvalds 2005-04-16 917
^1da177e4c3f4152 Linus Torvalds 2005-04-16 918 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 919 * Track a single file's readahead state
^1da177e4c3f4152 Linus Torvalds 2005-04-16 920 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 921 struct file_ra_state {
f9acc8c7b35a100f Fengguang Wu 2007-07-19 922 pgoff_t start; /* where readahead started */
937085aa35cc873d Fengguang Wu 2007-10-16 923 unsigned int size; /* # of readahead pages */
937085aa35cc873d Fengguang Wu 2007-10-16 924 unsigned int async_size; /* do asynchronous readahead when
f9acc8c7b35a100f Fengguang Wu 2007-07-19 925 there are only # of pages ahead */
5ce1110b92b31d07 Fengguang Wu 2007-07-19 926
937085aa35cc873d Fengguang Wu 2007-10-16 927 unsigned int ra_pages; /* Maximum readahead window */
1ebf26a9b338534d Wu Fengguang 2009-06-16 928 unsigned int mmap_miss; /* Cache miss stat for mmap accesses */
f4e6b498d6e06742 Fengguang Wu 2007-10-16 929 loff_t prev_pos; /* Cache last read() position */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 930 };
^1da177e4c3f4152 Linus Torvalds 2005-04-16 931
5ce1110b92b31d07 Fengguang Wu 2007-07-19 932 /*
5ce1110b92b31d07 Fengguang Wu 2007-07-19 933 * Check if @index falls in the readahead windows.
5ce1110b92b31d07 Fengguang Wu 2007-07-19 934 */
5ce1110b92b31d07 Fengguang Wu 2007-07-19 935 static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
5ce1110b92b31d07 Fengguang Wu 2007-07-19 936 {
f9acc8c7b35a100f Fengguang Wu 2007-07-19 937 return (index >= ra->start &&
f9acc8c7b35a100f Fengguang Wu 2007-07-19 938 index < ra->start + ra->size);
5ce1110b92b31d07 Fengguang Wu 2007-07-19 939 }
5ce1110b92b31d07 Fengguang Wu 2007-07-19 940
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @941 struct file {
2f51201662b28dbf Eric Dumazet 2005-10-30 942 union {
4f5e65a1cc90bbb1 Oleg Nesterov 2013-07-08 943 struct llist_node fu_llist;
2f51201662b28dbf Eric Dumazet 2005-10-30 944 struct rcu_head fu_rcuhead;
2f51201662b28dbf Eric Dumazet 2005-10-30 945 } f_u;
0f7fc9e4d03987fe Josef "Jeff" Sipek 2006-12-08 946 struct path f_path;
dd37978c50bc8b35 Al Viro 2013-03-01 947 struct inode *f_inode; /* cached value */
99ac48f54a91d021 Arjan van de Ven 2006-03-28 948 const struct file_operations *f_op;
ef3d0fd27e90f67e Andi Kleen 2011-09-15 949
ef3d0fd27e90f67e Andi Kleen 2011-09-15 950 /*
9c225f2655e36a47 Linus Torvalds 2014-03-03 951 * Protects f_ep_links, f_flags.
ef3d0fd27e90f67e Andi Kleen 2011-09-15 952 * Must not be taken from IRQ context.
ef3d0fd27e90f67e Andi Kleen 2011-09-15 953 */
ef3d0fd27e90f67e Andi Kleen 2011-09-15 954 spinlock_t f_lock;
c75b1d9421f80f41 Jens Axboe 2017-06-27 955 enum rw_hint f_write_hint;
516e0cc5646f377a Al Viro 2008-07-26 956 atomic_long_t f_count;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 957 unsigned int f_flags;
aeb5d727062a0238 Al Viro 2008-09-02 958 fmode_t f_mode;
9c225f2655e36a47 Linus Torvalds 2014-03-03 959 struct mutex f_pos_lock;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 960 loff_t f_pos;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 961 struct fown_struct f_owner;
d76b0d9b2d87cfc9 David Howells 2008-11-14 962 const struct cred *f_cred;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 963 struct file_ra_state f_ra;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 964
2b47c3611de05c58 Mathieu Desnoyers 2007-10-16 965 u64 f_version;
50462062a02226a6 Alexey Dobriyan 2006-09-29 966 #ifdef CONFIG_SECURITY
^1da177e4c3f4152 Linus Torvalds 2005-04-16 967 void *f_security;
50462062a02226a6 Alexey Dobriyan 2006-09-29 968 #endif
^1da177e4c3f4152 Linus Torvalds 2005-04-16 969 /* needed for tty driver, and maybe others */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 970 void *private_data;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 971
^1da177e4c3f4152 Linus Torvalds 2005-04-16 972 #ifdef CONFIG_EPOLL
^1da177e4c3f4152 Linus Torvalds 2005-04-16 973 /* Used by fs/eventpoll.c to link all the hooks to this file */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 974 struct list_head f_ep_links;
28d82dc1c4edbc35 Jason Baron 2012-01-12 975 struct list_head f_tfile_llink;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 976 #endif /* #ifdef CONFIG_EPOLL */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 977 struct address_space *f_mapping;
5660e13d2fd6af19 Jeff Layton 2017-07-06 978 errseq_t f_wb_err;
3859a271a003aba0 Kees Cook 2016-10-28 979 } __randomize_layout
3859a271a003aba0 Kees Cook 2016-10-28 980 __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 981
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 982 struct file_handle {
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 983 __u32 handle_bytes;
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 984 int handle_type;
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 985 /* file identifier */
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 986 unsigned char f_handle[0];
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 987 };
990d6c2d7aee921e Aneesh Kumar K.V 2011-01-29 988
cb0942b81249798e Al Viro 2012-08-27 989 static inline struct file *get_file(struct file *f)
cb0942b81249798e Al Viro 2012-08-27 990 {
cb0942b81249798e Al Viro 2012-08-27 991 atomic_long_inc(&f->f_count);
cb0942b81249798e Al Viro 2012-08-27 992 return f;
cb0942b81249798e Al Viro 2012-08-27 993 }
091141a42e15fe47 Jens Axboe 2018-11-21 994 #define get_file_rcu_many(x, cnt) \
091141a42e15fe47 Jens Axboe 2018-11-21 995 atomic_long_add_unless(&(x)->f_count, (cnt), 0)
091141a42e15fe47 Jens Axboe 2018-11-21 996 #define get_file_rcu(x) get_file_rcu_many((x), 1)
516e0cc5646f377a Al Viro 2008-07-26 997 #define file_count(x) atomic_long_read(&(x)->f_count)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 998
^1da177e4c3f4152 Linus Torvalds 2005-04-16 999 #define MAX_NON_LFS ((1UL<<31) - 1)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1000
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1001 /* Page cache limit. The filesystems should put that into their s_maxbytes
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1002 limits, otherwise bad things can happen in VM. */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1003 #if BITS_PER_LONG==32
0cc3b0ec23ce4c69 Linus Torvalds 2017-08-27 1004 #define MAX_LFS_FILESIZE ((loff_t)ULONG_MAX << PAGE_SHIFT)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1005 #elif BITS_PER_LONG==64
0cc3b0ec23ce4c69 Linus Torvalds 2017-08-27 1006 #define MAX_LFS_FILESIZE ((loff_t)LLONG_MAX)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1007 #endif
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1008
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1009 #define FL_POSIX 1
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1010 #define FL_FLOCK 2
617588d5186c887e J. Bruce Fields 2011-07-01 1011 #define FL_DELEG 4 /* NFSv4 delegation */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1012 #define FL_ACCESS 8 /* not trying to lock, just looking */
f475ae957db66650 Trond Myklebust 2006-06-29 1013 #define FL_EXISTS 16 /* when unlocking, test for existence */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1014 #define FL_LEASE 32 /* lease held on this file */
75e1fcc0b18df0a6 Miklos Szeredi 2006-06-23 1015 #define FL_CLOSE 64 /* unlock on close */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1016 #define FL_SLEEP 128 /* A blocking lock */
778fc546f749c588 J. Bruce Fields 2011-07-26 1017 #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */
778fc546f749c588 J. Bruce Fields 2011-07-26 1018 #define FL_UNLOCK_PENDING 512 /* Lease is being broken */
cff2fce58b2b0f59 Jeff Layton 2014-04-22 1019 #define FL_OFDLCK 1024 /* lock is "owned" by struct file */
11afe9f76e121e96 Christoph Hellwig 2015-01-21 1020 #define FL_LAYOUT 2048 /* outstanding pNFS layout */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1021
50f2112cf7a3e62a Benjamin Coddington 2017-04-11 1022 #define FL_CLOSE_POSIX (FL_POSIX | FL_CLOSE)
50f2112cf7a3e62a Benjamin Coddington 2017-04-11 1023
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1024 /*
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1025 * Special return value from posix_lock_file() and vfs_lock_file() for
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1026 * asynchronous locking.
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1027 */
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1028 #define FILE_LOCK_DEFERRED 1
bde74e4bc64415b1 Miklos Szeredi 2008-07-25 1029
7ca76311fe6c397e Jeff Layton 2014-09-01 1030 /* legacy typedef, should eventually be removed */
17fa388ddceb89e9 Christoph Hellwig 2014-07-13 @1031 typedef void *fl_owner_t;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1032
a7231a97467d5a0c Jeff Layton 2015-01-16 1033 struct file_lock;
a7231a97467d5a0c Jeff Layton 2015-01-16 1034
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1035 struct file_lock_operations {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1036 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1037 void (*fl_release_private)(struct file_lock *);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1038 };
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1039
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1040 struct lock_manager_operations {
cae80b305e1c3944 Jeff Layton 2015-04-03 @1041 fl_owner_t (*lm_get_owner)(fl_owner_t);
cae80b305e1c3944 Jeff Layton 2015-04-03 1042 void (*lm_put_owner)(fl_owner_t);
8fb47a4fbf858a16 J. Bruce Fields 2011-07-20 1043 void (*lm_notify)(struct file_lock *); /* unblock callback */
d0449b90f80f263e Joe Perches 2014-08-22 1044 int (*lm_grant)(struct file_lock *, int);
4d01b7f5e7576858 Jeff Layton 2014-09-01 1045 bool (*lm_break)(struct file_lock *);
7448cc37b1a6b620 Jeff Layton 2015-01-16 1046 int (*lm_change)(struct file_lock *, int, struct list_head *);
1c7dd2ff430fa14b Jeff Layton 2014-08-22 1047 void (*lm_setup)(struct file_lock *, void **);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1048 };
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1049
af558e33bedab672 J. Bruce Fields 2007-09-06 1050 struct lock_manager {
af558e33bedab672 J. Bruce Fields 2007-09-06 1051 struct list_head list;
c87fb4a378f93f11 J. Bruce Fields 2015-08-06 1052 /*
c87fb4a378f93f11 J. Bruce Fields 2015-08-06 1053 * NFSv4 and up also want opens blocked during the grace period;
c87fb4a378f93f11 J. Bruce Fields 2015-08-06 1054 * NLM doesn't care:
c87fb4a378f93f11 J. Bruce Fields 2015-08-06 1055 */
c87fb4a378f93f11 J. Bruce Fields 2015-08-06 1056 bool block_opens;
af558e33bedab672 J. Bruce Fields 2007-09-06 1057 };
af558e33bedab672 J. Bruce Fields 2007-09-06 1058
5ccb0066f2d56154 Stanislav Kinsbursky 2012-07-25 1059 struct net;
5ccb0066f2d56154 Stanislav Kinsbursky 2012-07-25 1060 void locks_start_grace(struct net *, struct lock_manager *);
af558e33bedab672 J. Bruce Fields 2007-09-06 1061 void locks_end_grace(struct lock_manager *);
003278e431bffa40 Corentin Labbe 2017-09-26 1062 bool locks_in_grace(struct net *);
003278e431bffa40 Corentin Labbe 2017-09-26 1063 bool opens_in_grace(struct net *);
af558e33bedab672 J. Bruce Fields 2007-09-06 1064
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1065 /* that will die - we need it for nfs_lock_info */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1066 #include <linux/nfs_fs_i.h>
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1067
1cb360125966cb6c Jeff Layton 2013-06-21 1068 /*
1cb360125966cb6c Jeff Layton 2013-06-21 1069 * struct file_lock represents a generic "file lock". It's used to represent
1cb360125966cb6c Jeff Layton 2013-06-21 1070 * POSIX byte range locks, BSD (flock) locks, and leases. It's important to
1cb360125966cb6c Jeff Layton 2013-06-21 1071 * note that the same struct is used to represent both a request for a lock and
1cb360125966cb6c Jeff Layton 2013-06-21 1072 * the lock itself, but the same object is never used for both.
1cb360125966cb6c Jeff Layton 2013-06-21 1073 *
1cb360125966cb6c Jeff Layton 2013-06-21 1074 * FIXME: should we create a separate "struct lock_request" to help distinguish
1cb360125966cb6c Jeff Layton 2013-06-21 1075 * these two uses?
1cb360125966cb6c Jeff Layton 2013-06-21 1076 *
8116bf4cb62d337c Jeff Layton 2015-01-21 1077 * The varous i_flctx lists are ordered by:
1cb360125966cb6c Jeff Layton 2013-06-21 1078 *
8116bf4cb62d337c Jeff Layton 2015-01-21 1079 * 1) lock owner
8116bf4cb62d337c Jeff Layton 2015-01-21 1080 * 2) lock range start
8116bf4cb62d337c Jeff Layton 2015-01-21 1081 * 3) lock range end
1cb360125966cb6c Jeff Layton 2013-06-21 1082 *
1cb360125966cb6c Jeff Layton 2013-06-21 1083 * Obviously, the last two criteria only matter for POSIX locks.
1cb360125966cb6c Jeff Layton 2013-06-21 1084 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @1085 struct file_lock {
ada5c1da8660ecae NeilBrown 2018-11-30 1086 struct file_lock *fl_blocker; /* The lock, that is blocking us */
6dee60f69d48fcef Jeff Layton 2015-01-16 1087 struct list_head fl_list; /* link into file_lock_context */
139ca04ee572fea6 Jeff Layton 2013-06-21 1088 struct hlist_node fl_link; /* node in global lists */
ada5c1da8660ecae NeilBrown 2018-11-30 1089 struct list_head fl_blocked_requests; /* list of requests with
ada5c1da8660ecae NeilBrown 2018-11-30 1090 * ->fl_blocker pointing here
ada5c1da8660ecae NeilBrown 2018-11-30 1091 */
ada5c1da8660ecae NeilBrown 2018-11-30 1092 struct list_head fl_blocked_member; /* node in
ada5c1da8660ecae NeilBrown 2018-11-30 1093 * ->fl_blocker->fl_blocked_requests
ada5c1da8660ecae NeilBrown 2018-11-30 1094 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @1095 fl_owner_t fl_owner;
710b7216964d6455 J. Bruce Fields 2011-07-26 1096 unsigned int fl_flags;
afc1246f917c664b Richard Kennedy 2008-07-11 1097 unsigned char fl_type;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1098 unsigned int fl_pid;
7012b02a2b2c42bb Jeff Layton 2013-06-21 1099 int fl_link_cpu; /* what cpu's list is this on? */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1100 wait_queue_head_t fl_wait;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1101 struct file *fl_file;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1102 loff_t fl_start;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1103 loff_t fl_end;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1104
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1105 struct fasync_struct * fl_fasync; /* for lease break notifications */
778fc546f749c588 J. Bruce Fields 2011-07-26 1106 /* for lease breaks: */
778fc546f749c588 J. Bruce Fields 2011-07-26 1107 unsigned long fl_break_time;
778fc546f749c588 J. Bruce Fields 2011-07-26 1108 unsigned long fl_downgrade_time;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1109
6aed62853c72e29f Alexey Dobriyan 2009-09-21 1110 const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
7b021967c5e14639 Alexey Dobriyan 2009-09-21 1111 const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1112 union {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1113 struct nfs_lock_info nfs_fl;
8d0a8a9d0ec79008 Trond Myklebust 2005-06-22 1114 struct nfs4_lock_info nfs4_fl;
e8d6c554126b8302 David Howells 2007-07-15 1115 struct {
e8d6c554126b8302 David Howells 2007-07-15 1116 struct list_head link; /* link in AFS vnode's pending_locks list */
e8d6c554126b8302 David Howells 2007-07-15 1117 int state; /* state of grant or error if -ve */
d46966013bb4f1fb David Howells 2019-04-25 1118 unsigned int debug_id;
e8d6c554126b8302 David Howells 2007-07-15 1119 } afs;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1120 } fl_u;
3859a271a003aba0 Kees Cook 2016-10-28 1121 } __randomize_layout;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 1122
:::::: The code at line 908 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 5057/6402] drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:5: warning: no previous prototype for function 'bcmgenet_hfb_add_filter'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: dfd71d381f7e1aa118e0368774aa05f5c4a48870
commit: 14da1510fedc2d72ca81344a0f62939e0a1bc648 [5057/6402] Revert "net: bcmgenet: remove unused function in bcmgenet.c"
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 14da1510fedc2d72ca81344a0f62939e0a1bc648
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:5: warning: no previous prototype for function 'bcmgenet_hfb_add_filter' [-Wmissing-prototypes]
int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
^
drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
^
static
drivers/net/ethernet/broadcom/genet/bcmgenet.c:120:26: warning: unused function 'dmadesc_get_addr' [-Wunused-function]
static inline dma_addr_t dmadesc_get_addr(struct bcmgenet_priv *priv,
^
2 warnings generated.
vim +/bcmgenet_hfb_add_filter +2858 drivers/net/ethernet/broadcom/genet/bcmgenet.c
2822
2823 /* bcmgenet_hfb_add_filter
2824 *
2825 * Add new filter to Hardware Filter Block to match and direct Rx traffic to
2826 * desired Rx queue.
2827 *
2828 * f_data is an array of unsigned 32-bit integers where each 32-bit integer
2829 * provides filter data for 2 bytes (4 nibbles) of Rx frame:
2830 *
2831 * bits 31:20 - unused
2832 * bit 19 - nibble 0 match enable
2833 * bit 18 - nibble 1 match enable
2834 * bit 17 - nibble 2 match enable
2835 * bit 16 - nibble 3 match enable
2836 * bits 15:12 - nibble 0 data
2837 * bits 11:8 - nibble 1 data
2838 * bits 7:4 - nibble 2 data
2839 * bits 3:0 - nibble 3 data
2840 *
2841 * Example:
2842 * In order to match:
2843 * - Ethernet frame type = 0x0800 (IP)
2844 * - IP version field = 4
2845 * - IP protocol field = 0x11 (UDP)
2846 *
2847 * The following filter is needed:
2848 * u32 hfb_filter_ipv4_udp[] = {
2849 * Rx frame offset 0x00: 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2850 * Rx frame offset 0x08: 0x00000000, 0x00000000, 0x000F0800, 0x00084000,
2851 * Rx frame offset 0x10: 0x00000000, 0x00000000, 0x00000000, 0x00030011,
2852 * };
2853 *
2854 * To add the filter to HFB and direct the traffic to Rx queue 0, call:
2855 * bcmgenet_hfb_add_filter(priv, hfb_filter_ipv4_udp,
2856 * ARRAY_SIZE(hfb_filter_ipv4_udp), 0);
2857 */
> 2858 int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
2859 u32 f_length, u32 rx_queue)
2860 {
2861 int f_index;
2862 u32 i;
2863
2864 f_index = bcmgenet_hfb_find_unused_filter(priv);
2865 if (f_index < 0)
2866 return -ENOMEM;
2867
2868 if (f_length > priv->hw_params->hfb_filter_size)
2869 return -EINVAL;
2870
2871 for (i = 0; i < f_length; i++)
2872 bcmgenet_hfb_writel(priv, f_data[i],
2873 (f_index * priv->hw_params->hfb_filter_size + i) *
2874 sizeof(u32));
2875
2876 bcmgenet_hfb_set_filter_length(priv, f_index, 2 * f_length);
2877 bcmgenet_hfb_set_filter_rx_queue_mapping(priv, f_index, rx_queue);
2878 bcmgenet_hfb_enable_filter(priv, f_index);
2879 bcmgenet_hfb_reg_writel(priv, 0x1, HFB_CTRL);
2880
2881 return 0;
2882 }
2883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[gabbayo:habanalabs-next 33/38] drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c:72:6: warning: variable 'rc' set but not used
by kbuild test robot
tree: git://people.freedesktop.org/~gabbayo/linux habanalabs-next
head: addd4be0a770e4cf5607310459cb7c8d11c8ae57
commit: f0fdc034c52b87d1c11bc28e2affd9d5a41a419b [33/38] habanalabs: add hwmgr module for gaudi
config: m68k-randconfig-r012-20200519 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f0fdc034c52b87d1c11bc28e2affd9d5a41a419b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c: In function 'clk_max_freq_mhz_store':
>> drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c:72:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
72 | int rc;
| ^~
vim +/rc +72 drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c
66
67 static ssize_t clk_max_freq_mhz_store(struct device *dev,
68 struct device_attribute *attr, const char *buf, size_t count)
69 {
70 struct hl_device *hdev = dev_get_drvdata(dev);
71 struct gaudi_device *gaudi = hdev->asic_specific;
> 72 int rc;
73 u64 value;
74
75 if (hl_device_disabled_or_in_reset(hdev)) {
76 count = -ENODEV;
77 goto fail;
78 }
79
80 rc = kstrtoull(buf, 0, &value);
81
82 gaudi->max_freq_value = value * 1000 * 1000;
83
84 hl_set_frequency(hdev, MME_PLL, gaudi->max_freq_value);
85
86 fail:
87 return count;
88 }
89
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[powerpc:next 17/110] arch/powerpc/kernel/fadump.c:513:18: warning: variable 'mem_boundary' set but not used
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
head: 30df74d67d48949da87e3a5b57c381763e8fd526
commit: 140777a3d8dfdb3d3f20ea7707c0f1c0ce1b0aa5 [17/110] powerpc/fadump: consider reserved ranges while reserving memory
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 140777a3d8dfdb3d3f20ea7707c0f1c0ce1b0aa5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
arch/powerpc/kernel/fadump.c:71:12: warning: no previous prototype for 'fadump_cma_init' [-Wmissing-prototypes]
71 | int __init fadump_cma_init(void)
| ^~~~~~~~~~~~~~~
arch/powerpc/kernel/fadump.c: In function 'fadump_reserve_mem':
>> arch/powerpc/kernel/fadump.c:513:18: warning: variable 'mem_boundary' set but not used [-Wunused-but-set-variable]
513 | u64 base, size, mem_boundary, bootmem_min;
| ^~~~~~~~~~~~
arch/powerpc/kernel/fadump.c: In function 'fadump_update_elfcore_header':
arch/powerpc/kernel/fadump.c:731:17: warning: variable 'elf' set but not used [-Wunused-but-set-variable]
731 | struct elfhdr *elf;
| ^~~
vim +/mem_boundary +513 arch/powerpc/kernel/fadump.c
510
511 int __init fadump_reserve_mem(void)
512 {
> 513 u64 base, size, mem_boundary, bootmem_min;
514 int ret = 1;
515
516 if (!fw_dump.fadump_enabled)
517 return 0;
518
519 if (!fw_dump.fadump_supported) {
520 pr_info("Firmware-Assisted Dump is not supported on this hardware\n");
521 goto error_out;
522 }
523
524 /*
525 * Initialize boot memory size
526 * If dump is active then we have already calculated the size during
527 * first kernel.
528 */
529 if (!fw_dump.dump_active) {
530 fw_dump.boot_memory_size =
531 PAGE_ALIGN(fadump_calculate_reserve_size());
532 #ifdef CONFIG_CMA
533 if (!fw_dump.nocma) {
534 fw_dump.boot_memory_size =
535 ALIGN(fw_dump.boot_memory_size,
536 FADUMP_CMA_ALIGNMENT);
537 }
538 #endif
539
540 bootmem_min = fw_dump.ops->fadump_get_bootmem_min();
541 if (fw_dump.boot_memory_size < bootmem_min) {
542 pr_err("Can't enable fadump with boot memory size (0x%lx) less than 0x%llx\n",
543 fw_dump.boot_memory_size, bootmem_min);
544 goto error_out;
545 }
546
547 if (!fadump_get_boot_mem_regions()) {
548 pr_err("Too many holes in boot memory area to enable fadump\n");
549 goto error_out;
550 }
551 }
552
553 /*
554 * Calculate the memory boundary.
555 * If memory_limit is less than actual memory boundary then reserve
556 * the memory for fadump beyond the memory_limit and adjust the
557 * memory_limit accordingly, so that the running kernel can run with
558 * specified memory_limit.
559 */
560 if (memory_limit && memory_limit < memblock_end_of_DRAM()) {
561 size = get_fadump_area_size();
562 if ((memory_limit + size) < memblock_end_of_DRAM())
563 memory_limit += size;
564 else
565 memory_limit = memblock_end_of_DRAM();
566 printk(KERN_INFO "Adjusted memory_limit for firmware-assisted"
567 " dump, now %#016llx\n", memory_limit);
568 }
569 if (memory_limit)
570 mem_boundary = memory_limit;
571 else
572 mem_boundary = memblock_end_of_DRAM();
573
574 base = fw_dump.boot_mem_top;
575 size = get_fadump_area_size();
576 fw_dump.reserve_dump_area_size = size;
577 if (fw_dump.dump_active) {
578 pr_info("Firmware-assisted dump is active.\n");
579
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months