Re: [PATCH v2 10/25] asm-generic/io.h: Add a non-posted variant of ioremap()
by kernel test robot
Hi Hector,
I love your patch! Yet something to improve:
[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on robh/for-next tty/tty-testing linus/master v5.11 next-20210212]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Hector-Martin/Apple-M1-SoC-platf...
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: mips-randconfig-r002-20210215 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/9785be3c8ec6cb8530d72cff794f5c224...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hector-Martin/Apple-M1-SoC-platform-bring-up/20210215-202520
git checkout 9785be3c8ec6cb8530d72cff794f5c22414f5a3e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
lib/devres.c: In function '__devm_ioremap':
>> lib/devres.c:47:10: error: implicit declaration of function 'ioremap_np'; did you mean 'ioremap_uc'? [-Werror=implicit-function-declaration]
47 | addr = ioremap_np(offset, size);
| ^~~~~~~~~~
| ioremap_uc
lib/devres.c:47:8: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
47 | addr = ioremap_np(offset, size);
| ^
cc1: some warnings being treated as errors
vim +47 lib/devres.c
25
26 static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset,
27 resource_size_t size,
28 enum devm_ioremap_type type)
29 {
30 void __iomem **ptr, *addr = NULL;
31
32 ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL);
33 if (!ptr)
34 return NULL;
35
36 switch (type) {
37 case DEVM_IOREMAP:
38 addr = ioremap(offset, size);
39 break;
40 case DEVM_IOREMAP_UC:
41 addr = ioremap_uc(offset, size);
42 break;
43 case DEVM_IOREMAP_WC:
44 addr = ioremap_wc(offset, size);
45 break;
46 case DEVM_IOREMAP_NP:
> 47 addr = ioremap_np(offset, size);
48 break;
49 }
50
51 if (addr) {
52 *ptr = addr;
53 devres_add(dev, ptr);
54 } else
55 devres_free(ptr);
56
57 return addr;
58 }
59
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH 1/1] v4l: async: Fix kerneldoc documentation for async functions
by kernel test robot
Hi Sakari,
I love your patch! Yet something to improve:
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20210212]
[cannot apply to v5.11]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sakari-Ailus/v4l-async-Fix-kerne...
base: git://linuxtv.org/media_tree.git master
config: arm64-randconfig-r006-20210215 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/8e8c47cba531c1706847f07a4af5cd19a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sakari-Ailus/v4l-async-Fix-kerneldoc-documentation-for-async-functions/20210215-204146
git checkout 8e8c47cba531c1706847f07a4af5cd19aa33f351
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/staging/media/tegra-video/vi.c:1815:10: error: expected expression
tvge = v4l2_async_notifier_add_fwnode_subdev(&chan->notifier,
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/staging/media/tegra-video/vi.c:1815:10: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
--
>> drivers/media/platform/am437x/am437x-vpfe.c:2366:19: error: expected expression
pdata->asd[i] = v4l2_async_notifier_add_fwnode_subdev(
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/am437x/am437x-vpfe.c:2366:19: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
--
>> drivers/media/platform/davinci/vpif_capture.c:1585:19: error: expected expression
pdata->asd[i] = v4l2_async_notifier_add_fwnode_subdev(
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/davinci/vpif_capture.c:1585:19: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
--
>> drivers/media/platform/qcom/camss/camss.c:669:9: error: expected expression
csd = v4l2_async_notifier_add_fwnode_subdev(
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/qcom/camss/camss.c:669:9: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
--
>> drivers/media/platform/rcar-vin/rcar-csi2.c:912:8: error: expected expression
asd = v4l2_async_notifier_add_fwnode_subdev(&priv->notifier, fwnode,
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/rcar-vin/rcar-csi2.c:912:8: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
--
>> drivers/media/platform/rcar-vin/rcar-core.c:644:8: error: expected expression
asd = v4l2_async_notifier_add_fwnode_subdev(&vin->notifier, fwnode,
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/rcar-vin/rcar-core.c:644:8: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
drivers/media/platform/rcar-vin/rcar-core.c:844:8: error: expected expression
asd = v4l2_async_notifier_add_fwnode_subdev(&vin->group->notifier,
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
drivers/media/platform/rcar-vin/rcar-core.c:844:8: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
4 errors generated.
--
>> drivers/media/platform/xilinx/xilinx-vipp.c:385:9: error: expected expression
xge = v4l2_async_notifier_add_fwnode_subdev(
^
include/media/v4l2-async.h:179:12: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
>> drivers/media/platform/xilinx/xilinx-vipp.c:385:9: error: use of undeclared identifier '__type'; did you mean '_ctype'?
include/media/v4l2-async.h:179:4: note: expanded from macro 'v4l2_async_notifier_add_fwnode_subdev'
((__type *)__v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode, \
^
include/linux/ctype.h:21:28: note: '_ctype' declared here
extern const unsigned char _ctype[];
^
2 errors generated.
vim +1815 drivers/staging/media/tegra-video/vi.c
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1784
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1785 static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1786 struct fwnode_handle *fwnode)
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1787 {
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1788 struct tegra_vi *vi = chan->vi;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1789 struct fwnode_handle *ep = NULL;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1790 struct fwnode_handle *remote = NULL;
b01edcbd409cf7 Laurent Pinchart 2021-01-18 1791 struct tegra_vi_graph_entity *tvge;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1792 struct device_node *node = NULL;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1793 int ret;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1794
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1795 dev_dbg(vi->dev, "parsing node %pOF\n", to_of_node(fwnode));
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1796
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1797 /* parse all the remote entities and put them into the list */
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1798 for_each_endpoint_of_node(to_of_node(fwnode), node) {
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1799 ep = of_fwnode_handle(node);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1800 remote = fwnode_graph_get_remote_port_parent(ep);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1801 if (!remote) {
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1802 dev_err(vi->dev,
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1803 "remote device at %pOF not found\n", node);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1804 ret = -EINVAL;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1805 goto cleanup;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1806 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1807
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1808 /* skip entities that are already processed */
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1809 if (remote == dev_fwnode(vi->dev) ||
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1810 tegra_vi_graph_find_entity(chan, remote)) {
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1811 fwnode_handle_put(remote);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1812 continue;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1813 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1814
b01edcbd409cf7 Laurent Pinchart 2021-01-18 @1815 tvge = v4l2_async_notifier_add_fwnode_subdev(&chan->notifier,
b01edcbd409cf7 Laurent Pinchart 2021-01-18 1816 remote, struct tegra_vi_graph_entity);
b01edcbd409cf7 Laurent Pinchart 2021-01-18 1817 if (IS_ERR(tvge)) {
b01edcbd409cf7 Laurent Pinchart 2021-01-18 1818 ret = PTR_ERR(tvge);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1819 dev_err(vi->dev,
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1820 "failed to add subdev to notifier: %d\n", ret);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1821 fwnode_handle_put(remote);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1822 goto cleanup;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1823 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1824
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1825 ret = tegra_vi_graph_parse_one(chan, remote);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1826 if (ret < 0) {
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1827 fwnode_handle_put(remote);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1828 goto cleanup;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1829 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1830
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1831 fwnode_handle_put(remote);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1832 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1833
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1834 return 0;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1835
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1836 cleanup:
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1837 dev_err(vi->dev, "failed parsing the graph: %d\n", ret);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1838 v4l2_async_notifier_cleanup(&chan->notifier);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1839 of_node_put(node);
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1840 return ret;
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1841 }
1ebaeb09830f36 Sowjanya Komatineni 2020-08-12 1842
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v6 6/7] Reimplement RLIMIT_MEMLOCK on top of ucounts
by kernel test robot
Hi Alexey,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kselftest/next]
[also build test ERROR on linux/master linus/master v5.11 next-20210212]
[cannot apply to hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Alexey-Gladkov/Count-rlimits-in-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
config: xtensa-common_defconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
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
# https://github.com/0day-ci/linux/commit/f009495a8def89a71b9e0b9025a39379d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexey-Gladkov/Count-rlimits-in-each-user-namespace/20210215-204524
git checkout f009495a8def89a71b9e0b9025a39379d6f9097d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ipc/shm.c: In function 'newseg':
>> ipc/shm.c:653:5: error: passing argument 4 of 'hugetlb_file_setup' from incompatible pointer type [-Werror=incompatible-pointer-types]
653 | &shp->mlock_cred, HUGETLB_SHMFS_INODE,
| ^~~~~~~~~~~~~~~~
| |
| const struct cred **
In file included from ipc/shm.c:30:
include/linux/hugetlb.h:457:17: note: expected 'struct cred **' but argument is of type 'const struct cred **'
457 | struct cred **cred, int creat_flags,
| ~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
vim +/hugetlb_file_setup +653 ipc/shm.c
592
593 /**
594 * newseg - Create a new shared memory segment
595 * @ns: namespace
596 * @params: ptr to the structure that contains key, size and shmflg
597 *
598 * Called with shm_ids.rwsem held as a writer.
599 */
600 static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
601 {
602 key_t key = params->key;
603 int shmflg = params->flg;
604 size_t size = params->u.size;
605 int error;
606 struct shmid_kernel *shp;
607 size_t numpages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
608 struct file *file;
609 char name[13];
610 vm_flags_t acctflag = 0;
611
612 if (size < SHMMIN || size > ns->shm_ctlmax)
613 return -EINVAL;
614
615 if (numpages << PAGE_SHIFT < size)
616 return -ENOSPC;
617
618 if (ns->shm_tot + numpages < ns->shm_tot ||
619 ns->shm_tot + numpages > ns->shm_ctlall)
620 return -ENOSPC;
621
622 shp = kvmalloc(sizeof(*shp), GFP_KERNEL);
623 if (unlikely(!shp))
624 return -ENOMEM;
625
626 shp->shm_perm.key = key;
627 shp->shm_perm.mode = (shmflg & S_IRWXUGO);
628 shp->mlock_cred = NULL;
629
630 shp->shm_perm.security = NULL;
631 error = security_shm_alloc(&shp->shm_perm);
632 if (error) {
633 kvfree(shp);
634 return error;
635 }
636
637 sprintf(name, "SYSV%08x", key);
638 if (shmflg & SHM_HUGETLB) {
639 struct hstate *hs;
640 size_t hugesize;
641
642 hs = hstate_sizelog((shmflg >> SHM_HUGE_SHIFT) & SHM_HUGE_MASK);
643 if (!hs) {
644 error = -EINVAL;
645 goto no_file;
646 }
647 hugesize = ALIGN(size, huge_page_size(hs));
648
649 /* hugetlb_file_setup applies strict accounting */
650 if (shmflg & SHM_NORESERVE)
651 acctflag = VM_NORESERVE;
652 file = hugetlb_file_setup(name, hugesize, acctflag,
> 653 &shp->mlock_cred, HUGETLB_SHMFS_INODE,
654 (shmflg >> SHM_HUGE_SHIFT) & SHM_HUGE_MASK);
655 } else {
656 /*
657 * Do not allow no accounting for OVERCOMMIT_NEVER, even
658 * if it's asked for.
659 */
660 if ((shmflg & SHM_NORESERVE) &&
661 sysctl_overcommit_memory != OVERCOMMIT_NEVER)
662 acctflag = VM_NORESERVE;
663 file = shmem_kernel_file_setup(name, size, acctflag);
664 }
665 error = PTR_ERR(file);
666 if (IS_ERR(file)) {
667 shp->mlock_cred = NULL;
668 goto no_file;
669 }
670
671 shp->shm_cprid = get_pid(task_tgid(current));
672 shp->shm_lprid = NULL;
673 shp->shm_atim = shp->shm_dtim = 0;
674 shp->shm_ctim = ktime_get_real_seconds();
675 shp->shm_segsz = size;
676 shp->shm_nattch = 0;
677 shp->shm_file = file;
678 shp->shm_creator = current;
679
680 /* ipc_addid() locks shp upon success. */
681 error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
682 if (error < 0)
683 goto no_id;
684
685 list_add(&shp->shm_clist, ¤t->sysvshm.shm_clist);
686
687 /*
688 * shmid gets reported as "inode#" in /proc/pid/maps.
689 * proc-ps tools use this. Changing this will break them.
690 */
691 file_inode(file)->i_ino = shp->shm_perm.id;
692
693 ns->shm_tot += numpages;
694 error = shp->shm_perm.id;
695
696 ipc_unlock_object(&shp->shm_perm);
697 rcu_read_unlock();
698 return error;
699
700 no_id:
701 ipc_update_pid(&shp->shm_cprid, NULL);
702 ipc_update_pid(&shp->shm_lprid, NULL);
703 if (is_file_hugepages(file) && shp->mlock_cred)
704 user_shm_unlock(size, shp->mlock_cred);
705 fput(file);
706 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free);
707 return error;
708 no_file:
709 call_rcu(&shp->shm_perm.rcu, shm_rcu_free);
710 return error;
711 }
712
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[linux-next:master 2008/11103] drivers/iio/magnetometer/yamaha-yas530.c:891 yas5xx_probe() warn: missing error code 'ret'
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 07f7e57c63aaa2afb4ea31edef05e08699a63a00
commit: de8860b1ed4701ea7e6f760f02d79ca6a3b656a1 [2008/11103] iio: magnetometer: Add driver for Yamaha YAS530
config: x86_64-randconfig-m001-20210215 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/iio/magnetometer/yamaha-yas530.c:891 yas5xx_probe() warn: missing error code 'ret'
vim +/ret +891 drivers/iio/magnetometer/yamaha-yas530.c
de8860b1ed4701 Linus Walleij 2020-12-24 816 static int yas5xx_probe(struct i2c_client *i2c,
de8860b1ed4701 Linus Walleij 2020-12-24 817 const struct i2c_device_id *id)
de8860b1ed4701 Linus Walleij 2020-12-24 818 {
de8860b1ed4701 Linus Walleij 2020-12-24 819 struct iio_dev *indio_dev;
de8860b1ed4701 Linus Walleij 2020-12-24 820 struct device *dev = &i2c->dev;
de8860b1ed4701 Linus Walleij 2020-12-24 821 struct yas5xx *yas5xx;
de8860b1ed4701 Linus Walleij 2020-12-24 822 int ret;
de8860b1ed4701 Linus Walleij 2020-12-24 823
de8860b1ed4701 Linus Walleij 2020-12-24 824 indio_dev = devm_iio_device_alloc(dev, sizeof(*yas5xx));
de8860b1ed4701 Linus Walleij 2020-12-24 825 if (!indio_dev)
de8860b1ed4701 Linus Walleij 2020-12-24 826 return -ENOMEM;
de8860b1ed4701 Linus Walleij 2020-12-24 827
de8860b1ed4701 Linus Walleij 2020-12-24 828 yas5xx = iio_priv(indio_dev);
de8860b1ed4701 Linus Walleij 2020-12-24 829 i2c_set_clientdata(i2c, indio_dev);
de8860b1ed4701 Linus Walleij 2020-12-24 830 yas5xx->dev = dev;
de8860b1ed4701 Linus Walleij 2020-12-24 831 mutex_init(&yas5xx->lock);
de8860b1ed4701 Linus Walleij 2020-12-24 832
de8860b1ed4701 Linus Walleij 2020-12-24 833 ret = iio_read_mount_matrix(dev, "mount-matrix", &yas5xx->orientation);
de8860b1ed4701 Linus Walleij 2020-12-24 834 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 835 return ret;
de8860b1ed4701 Linus Walleij 2020-12-24 836
de8860b1ed4701 Linus Walleij 2020-12-24 837 yas5xx->regs[0].supply = "vdd";
de8860b1ed4701 Linus Walleij 2020-12-24 838 yas5xx->regs[1].supply = "iovdd";
de8860b1ed4701 Linus Walleij 2020-12-24 839 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(yas5xx->regs),
de8860b1ed4701 Linus Walleij 2020-12-24 840 yas5xx->regs);
de8860b1ed4701 Linus Walleij 2020-12-24 841 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 842 return dev_err_probe(dev, ret, "cannot get regulators\n");
de8860b1ed4701 Linus Walleij 2020-12-24 843
de8860b1ed4701 Linus Walleij 2020-12-24 844 ret = regulator_bulk_enable(ARRAY_SIZE(yas5xx->regs), yas5xx->regs);
de8860b1ed4701 Linus Walleij 2020-12-24 845 if (ret) {
de8860b1ed4701 Linus Walleij 2020-12-24 846 dev_err(dev, "cannot enable regulators\n");
de8860b1ed4701 Linus Walleij 2020-12-24 847 return ret;
de8860b1ed4701 Linus Walleij 2020-12-24 848 }
de8860b1ed4701 Linus Walleij 2020-12-24 849
de8860b1ed4701 Linus Walleij 2020-12-24 850 /* See comment in runtime resume callback */
de8860b1ed4701 Linus Walleij 2020-12-24 851 usleep_range(31000, 40000);
de8860b1ed4701 Linus Walleij 2020-12-24 852
de8860b1ed4701 Linus Walleij 2020-12-24 853 /* This will take the device out of reset if need be */
de8860b1ed4701 Linus Walleij 2020-12-24 854 yas5xx->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
de8860b1ed4701 Linus Walleij 2020-12-24 855 if (IS_ERR(yas5xx->reset)) {
de8860b1ed4701 Linus Walleij 2020-12-24 856 ret = dev_err_probe(dev, PTR_ERR(yas5xx->reset),
de8860b1ed4701 Linus Walleij 2020-12-24 857 "failed to get reset line\n");
de8860b1ed4701 Linus Walleij 2020-12-24 858 goto reg_off;
de8860b1ed4701 Linus Walleij 2020-12-24 859 }
de8860b1ed4701 Linus Walleij 2020-12-24 860
de8860b1ed4701 Linus Walleij 2020-12-24 861 yas5xx->map = devm_regmap_init_i2c(i2c, &yas5xx_regmap_config);
de8860b1ed4701 Linus Walleij 2020-12-24 862 if (IS_ERR(yas5xx->map)) {
de8860b1ed4701 Linus Walleij 2020-12-24 863 dev_err(dev, "failed to allocate register map\n");
de8860b1ed4701 Linus Walleij 2020-12-24 864 ret = PTR_ERR(yas5xx->map);
de8860b1ed4701 Linus Walleij 2020-12-24 865 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 866 }
de8860b1ed4701 Linus Walleij 2020-12-24 867
de8860b1ed4701 Linus Walleij 2020-12-24 868 ret = regmap_read(yas5xx->map, YAS5XX_DEVICE_ID, &yas5xx->devid);
de8860b1ed4701 Linus Walleij 2020-12-24 869 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 870 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 871
de8860b1ed4701 Linus Walleij 2020-12-24 872 switch (yas5xx->devid) {
de8860b1ed4701 Linus Walleij 2020-12-24 873 case YAS530_DEVICE_ID:
de8860b1ed4701 Linus Walleij 2020-12-24 874 ret = yas530_get_calibration_data(yas5xx);
de8860b1ed4701 Linus Walleij 2020-12-24 875 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 876 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 877 dev_info(dev, "detected YAS530 MS-3E %s",
de8860b1ed4701 Linus Walleij 2020-12-24 878 yas5xx->version ? "B" : "A");
de8860b1ed4701 Linus Walleij 2020-12-24 879 strncpy(yas5xx->name, "yas530", sizeof(yas5xx->name));
de8860b1ed4701 Linus Walleij 2020-12-24 880 break;
de8860b1ed4701 Linus Walleij 2020-12-24 881 case YAS532_DEVICE_ID:
de8860b1ed4701 Linus Walleij 2020-12-24 882 ret = yas532_get_calibration_data(yas5xx);
de8860b1ed4701 Linus Walleij 2020-12-24 883 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 884 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 885 dev_info(dev, "detected YAS532/YAS533 MS-3R/F %s",
de8860b1ed4701 Linus Walleij 2020-12-24 886 yas5xx->version ? "AC" : "AB");
de8860b1ed4701 Linus Walleij 2020-12-24 887 strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name));
de8860b1ed4701 Linus Walleij 2020-12-24 888 break;
de8860b1ed4701 Linus Walleij 2020-12-24 889 default:
de8860b1ed4701 Linus Walleij 2020-12-24 890 dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid);
de8860b1ed4701 Linus Walleij 2020-12-24 @891 goto assert_reset;
"ret = -EINVAL;"
de8860b1ed4701 Linus Walleij 2020-12-24 892 }
de8860b1ed4701 Linus Walleij 2020-12-24 893
de8860b1ed4701 Linus Walleij 2020-12-24 894 yas5xx_dump_calibration(yas5xx);
de8860b1ed4701 Linus Walleij 2020-12-24 895 ret = yas5xx_power_on(yas5xx);
de8860b1ed4701 Linus Walleij 2020-12-24 896 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 897 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 898 ret = yas5xx_meaure_offsets(yas5xx);
de8860b1ed4701 Linus Walleij 2020-12-24 899 if (ret)
de8860b1ed4701 Linus Walleij 2020-12-24 900 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 901
de8860b1ed4701 Linus Walleij 2020-12-24 902 indio_dev->info = &yas5xx_info;
de8860b1ed4701 Linus Walleij 2020-12-24 903 indio_dev->available_scan_masks = yas5xx_scan_masks;
de8860b1ed4701 Linus Walleij 2020-12-24 904 indio_dev->modes = INDIO_DIRECT_MODE;
de8860b1ed4701 Linus Walleij 2020-12-24 905 indio_dev->name = yas5xx->name;
de8860b1ed4701 Linus Walleij 2020-12-24 906 indio_dev->channels = yas5xx_channels;
de8860b1ed4701 Linus Walleij 2020-12-24 907 indio_dev->num_channels = ARRAY_SIZE(yas5xx_channels);
de8860b1ed4701 Linus Walleij 2020-12-24 908
de8860b1ed4701 Linus Walleij 2020-12-24 909 ret = iio_triggered_buffer_setup(indio_dev, NULL,
de8860b1ed4701 Linus Walleij 2020-12-24 910 yas5xx_handle_trigger,
de8860b1ed4701 Linus Walleij 2020-12-24 911 NULL);
de8860b1ed4701 Linus Walleij 2020-12-24 912 if (ret) {
de8860b1ed4701 Linus Walleij 2020-12-24 913 dev_err(dev, "triggered buffer setup failed\n");
de8860b1ed4701 Linus Walleij 2020-12-24 914 goto assert_reset;
de8860b1ed4701 Linus Walleij 2020-12-24 915 }
de8860b1ed4701 Linus Walleij 2020-12-24 916
de8860b1ed4701 Linus Walleij 2020-12-24 917 ret = iio_device_register(indio_dev);
de8860b1ed4701 Linus Walleij 2020-12-24 918 if (ret) {
de8860b1ed4701 Linus Walleij 2020-12-24 919 dev_err(dev, "device register failed\n");
de8860b1ed4701 Linus Walleij 2020-12-24 920 goto cleanup_buffer;
de8860b1ed4701 Linus Walleij 2020-12-24 921 }
de8860b1ed4701 Linus Walleij 2020-12-24 922
de8860b1ed4701 Linus Walleij 2020-12-24 923 /* Take runtime PM online */
de8860b1ed4701 Linus Walleij 2020-12-24 924 pm_runtime_get_noresume(dev);
de8860b1ed4701 Linus Walleij 2020-12-24 925 pm_runtime_set_active(dev);
de8860b1ed4701 Linus Walleij 2020-12-24 926 pm_runtime_enable(dev);
de8860b1ed4701 Linus Walleij 2020-12-24 927
de8860b1ed4701 Linus Walleij 2020-12-24 928 pm_runtime_set_autosuspend_delay(dev, YAS5XX_AUTOSUSPEND_DELAY_MS);
de8860b1ed4701 Linus Walleij 2020-12-24 929 pm_runtime_use_autosuspend(dev);
de8860b1ed4701 Linus Walleij 2020-12-24 930 pm_runtime_put(dev);
de8860b1ed4701 Linus Walleij 2020-12-24 931
de8860b1ed4701 Linus Walleij 2020-12-24 932 return 0;
de8860b1ed4701 Linus Walleij 2020-12-24 933
de8860b1ed4701 Linus Walleij 2020-12-24 934 cleanup_buffer:
de8860b1ed4701 Linus Walleij 2020-12-24 935 iio_triggered_buffer_cleanup(indio_dev);
de8860b1ed4701 Linus Walleij 2020-12-24 936 assert_reset:
de8860b1ed4701 Linus Walleij 2020-12-24 937 gpiod_set_value_cansleep(yas5xx->reset, 1);
de8860b1ed4701 Linus Walleij 2020-12-24 938 reg_off:
de8860b1ed4701 Linus Walleij 2020-12-24 939 regulator_bulk_disable(ARRAY_SIZE(yas5xx->regs), yas5xx->regs);
de8860b1ed4701 Linus Walleij 2020-12-24 940
de8860b1ed4701 Linus Walleij 2020-12-24 941 return ret;
de8860b1ed4701 Linus Walleij 2020-12-24 942 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[iio:testing 19/19] drivers/iio/test/iio-test-format.c:98:1: warning: the frame size of 2336 bytes is larger than 2048 bytes
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: 3347b9d6388587963d199b107278f89f05277a1b
commit: 3347b9d6388587963d199b107278f89f05277a1b [19/19] iio: Add basic unit test for iio_format_value()
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=...
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio testing
git checkout 3347b9d6388587963d199b107278f89f05277a1b
# 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: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/iio/test/iio-test-format.c: In function 'iio_test_iio_format_value_fixedpoint':
>> drivers/iio/test/iio-test-format.c:98:1: warning: the frame size of 2336 bytes is larger than 2048 bytes [-Wframe-larger-than=]
98 | }
| ^
vim +98 drivers/iio/test/iio-test-format.c
41
42 static void iio_test_iio_format_value_fixedpoint(struct kunit *test)
43 {
44 char *buf = kunit_kmalloc(test, PAGE_SIZE, GFP_KERNEL);
45 int values[2];
46 int ret;
47
48 /* positive >= 1 */
49 values[0] = 1;
50 values[1] = 10;
51
52 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, values);
53 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "1.000010\n");
54
55 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO_DB, 2, values);
56 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "1.000010 dB\n");
57
58 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_NANO, 2, values);
59 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "1.000000010\n");
60
61 /* positive < 1 */
62 values[0] = 0;
63 values[1] = 12;
64
65 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, values);
66 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0.000012\n");
67
68 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO_DB, 2, values);
69 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0.000012 dB\n");
70
71 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_NANO, 2, values);
72 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0.000000012\n");
73
74 /* negative <= -1 */
75 values[0] = -1;
76 values[1] = 10;
77
78 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, values);
79 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-1.000010\n");
80
81 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO_DB, 2, values);
82 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-1.000010 dB\n");
83
84 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_NANO, 2, values);
85 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-1.000000010\n");
86
87 /* negative > -1 */
88 values[0] = 0;
89 values[1] = -123;
90 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, values);
91 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-0.000123\n");
92
93 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO_DB, 2, values);
94 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-0.000123 dB\n");
95
96 ret = iio_format_value(buf, IIO_VAL_INT_PLUS_NANO, 2, values);
97 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-0.000000123\n");
> 98 }
99
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [rdma-rdma:wip/jgg-for-next 198/203] drivers/infiniband/ulp/rtrs/rtrs-srv.c:1805 rtrs_rdma_connect() warn: passing zero to 'PTR_ERR'
by Dan Carpenter
On Mon, Feb 15, 2021 at 03:02:32PM +0100, Jinpu Wang wrote:
> On Mon, Feb 15, 2021 at 2:58 PM Dan Carpenter <dan.carpenter(a)oracle.com> wrote:
> >
> > On Mon, Feb 15, 2021 at 02:03:31PM +0100, Jinpu Wang wrote:
> > > Hi, Dan,
> > >
> > > On Mon, Feb 15, 2021 at 1:44 PM Dan Carpenter <dan.carpenter(a)oracle.com> wrote:
> > > >
> > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git wip/jgg-for-next
> > > > head: c88b31c46cefe50f524a1ad3deaf1599bc9ee2e6
> > > > commit: f0751419d3a15fb06d9b7d9435312472c3cb122d [198/203] RDMA/rtrs: Only allow addition of path to an already established session
> > > > config: ia64-randconfig-m031-20210209 (attached as .config)
> > > > compiler: ia64-linux-gcc (GCC) 9.3.0
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp(a)intel.com>
> > > > Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
> > > >
> > > > smatch warnings:
> > > > drivers/infiniband/ulp/rtrs/rtrs-srv.c:1805 rtrs_rdma_connect() warn: passing zero to 'PTR_ERR'
> > > >
> > > > vim +/PTR_ERR +1805 drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > >
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1760 static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1761 const struct rtrs_msg_conn_req *msg,
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1762 size_t len)
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1763 {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1764 struct rtrs_srv_ctx *ctx = cm_id->context;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1765 struct rtrs_srv_sess *sess;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1766 struct rtrs_srv *srv;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1767
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1768 u16 version, con_num, cid;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1769 u16 recon_cnt;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1770 int err;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1771
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1772 if (len < sizeof(*msg)) {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1773 pr_err("Invalid RTRS connection request\n");
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1774 goto reject_w_econnreset;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1775 }
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1776 if (le16_to_cpu(msg->magic) != RTRS_MAGIC) {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1777 pr_err("Invalid RTRS magic\n");
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1778 goto reject_w_econnreset;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1779 }
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1780 version = le16_to_cpu(msg->version);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1781 if (version >> 8 != RTRS_PROTO_VER_MAJOR) {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1782 pr_err("Unsupported major RTRS version: %d, expected %d\n",
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1783 version >> 8, RTRS_PROTO_VER_MAJOR);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1784 goto reject_w_econnreset;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1785 }
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1786 con_num = le16_to_cpu(msg->cid_num);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1787 if (con_num > 4096) {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1788 /* Sanity check */
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1789 pr_err("Too many connections requested: %d\n", con_num);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1790 goto reject_w_econnreset;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1791 }
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1792 cid = le16_to_cpu(msg->cid);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1793 if (cid >= con_num) {
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1794 /* Sanity check */
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1795 pr_err("Incorrect cid: %d >= %d\n", cid, con_num);
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1796 goto reject_w_econnreset;
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1797 }
> > > > 9cb837480424e7 Jack Wang 2020-05-11 1798 recon_cnt = le16_to_cpu(msg->recon_cnt);
> > > > f0751419d3a15f Md Haris Iqbal 2021-02-12 1799 srv = get_or_create_srv(ctx, &msg->paths_uuid, msg->first_conn);
> > > > d715ff8acbd587 Guoqing Jiang 2020-10-23 1800 /*
> > > > d715ff8acbd587 Guoqing Jiang 2020-10-23 1801 * "refcount == 0" happens if a previous thread calls get_or_create_srv
> > > > d715ff8acbd587 Guoqing Jiang 2020-10-23 1802 * allocate srv, but chunks of srv are not allocated yet.
> > > > d715ff8acbd587 Guoqing Jiang 2020-10-23 1803 */
> > > > f0751419d3a15f Md Haris Iqbal 2021-02-12 1804 if (IS_ERR(srv) || refcount_read(&srv->refcount) == 0) {
> > > > f0751419d3a15f Md Haris Iqbal 2021-02-12 @1805 err = PTR_ERR(srv);
> > > >
> > > > It's not 100% clear to me that an error code is required when
> > > > refcount_read() is zero. Maybe "err = 0;" is okay in that situation?
> > > I don't see how srv can be zero
> >
> > The cross function database was probably out of date.
>
> Thanks for the hint, just curious where is the cross-function
> database? is it auto-generated by gcc during compile?
This is a Smatch warning.
https://www.spinics.net/lists/smatch/msg00568.html
regards,
dan carpenter
1 year, 7 months
Re: [PATCH net-next 09/12] net: dsa: tag_ocelot: create separate tagger for Seville
by Dan Carpenter
On Mon, Feb 15, 2021 at 03:19:31PM +0200, Vladimir Oltean wrote:
> Hi Dan,
>
> On Mon, Feb 15, 2021 at 04:00:04PM +0300, Dan Carpenter wrote:
> > db->index is less than db->num_ports which 32 or less but sometimes it
> > comes from the device tree so who knows.
>
> The destination port mask is copied into a 12-bit field of the packet,
> starting at bit offset 67 and ending at 56:
>
> static inline void ocelot_ifh_set_dest(void *injection, u64 dest)
> {
> packing(injection, &dest, 67, 56, OCELOT_TAG_LEN, PACK, 0);
> }
>
> So this DSA tagging protocol supports at most 12 bits, which is clearly
> less than 32. Attempting to send to a port number > 12 will cause the
> packing() call to truncate way before there will be 32-bit truncation
> due to type promotion of the BIT(port) argument towards u64.
>
> > The ocelot_ifh_set_dest() function takes a u64 though and that
> > suggests that BIT() should be changed to BIT_ULL().
>
> I understand that you want to silence the warning, which fundamentally
> comes from the packing() API which works with u64 values and nothing of
> a smaller size. So I can send a patch which replaces BIT(port) with
> BIT_ULL(port), even if in practice both are equally fine.
I don't have a strong feeling about this... Generally silencing
warnings just to make a checker happy is the wrong idea.
To be honest, I normally ignore these warnings. But I have been looking
at them recently to try figure out if we could make it so it would only
generate a warning where "db->index" was known as possibly being in the
32-63 range. So I looked at this one.
And now I see some ways that Smatch could have parsed this better...
regards,
dan carpenter
1 year, 7 months
Re: [RFC PATCH 2/2] Make cmdq_en attribute writeable
by Dan Carpenter
Hi Luca,
url: https://github.com/0day-ci/linux/commits/Luca-Porzio/Support-temporarily-...
base: 07f7e57c63aaa2afb4ea31edef05e08699a63a00
config: i386-randconfig-m021-20210215 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/mmc/core/mmc.c:870 mmc_cmdq_setup() error: uninitialized symbol 'err'.
drivers/mmc/core/mmc.c:889 cmdq_en_store() warn: variable dereferenced before check 'card' (see line 885)
vim +/err +870 drivers/mmc/core/mmc.c
07a9ce0e702520 Luca Porzio 2021-02-15 802 static int mmc_cmdq_setup(struct mmc_host *host, struct mmc_card *card)
07a9ce0e702520 Luca Porzio 2021-02-15 803 {
07a9ce0e702520 Luca Porzio 2021-02-15 804 int err;
07a9ce0e702520 Luca Porzio 2021-02-15 805
07a9ce0e702520 Luca Porzio 2021-02-15 806 /* Check HW support */
07a9ce0e702520 Luca Porzio 2021-02-15 807 if (!card->ext_csd.cmdq_support || !(host->caps2 & MMC_CAP2_CQE))
07a9ce0e702520 Luca Porzio 2021-02-15 808 card->force_disable_cmdq = true;
07a9ce0e702520 Luca Porzio 2021-02-15 809
07a9ce0e702520 Luca Porzio 2021-02-15 810 /* Enable/Disable CMDQ mode */
07a9ce0e702520 Luca Porzio 2021-02-15 811 if (!card->ext_csd.cmdq_en && !card->force_disable_cmdq) {
07a9ce0e702520 Luca Porzio 2021-02-15 812 err = mmc_cmdq_enable(card);
07a9ce0e702520 Luca Porzio 2021-02-15 813 if (err && err != -EBADMSG)
07a9ce0e702520 Luca Porzio 2021-02-15 814 return err;
07a9ce0e702520 Luca Porzio 2021-02-15 815 if (err) {
07a9ce0e702520 Luca Porzio 2021-02-15 816 pr_warn("%s: Enabling CMDQ failed\n",
07a9ce0e702520 Luca Porzio 2021-02-15 817 mmc_hostname(card->host));
07a9ce0e702520 Luca Porzio 2021-02-15 818 card->ext_csd.cmdq_support = false;
07a9ce0e702520 Luca Porzio 2021-02-15 819 card->ext_csd.cmdq_depth = 0;
07a9ce0e702520 Luca Porzio 2021-02-15 820 }
07a9ce0e702520 Luca Porzio 2021-02-15 821
07a9ce0e702520 Luca Porzio 2021-02-15 822 } else if (card->ext_csd.cmdq_en && card->force_disable_cmdq) {
07a9ce0e702520 Luca Porzio 2021-02-15 823 err = mmc_cmdq_disable(card);
07a9ce0e702520 Luca Porzio 2021-02-15 824 if (err) {
07a9ce0e702520 Luca Porzio 2021-02-15 825 pr_warn("%s: Disabling CMDQ failed, error %d\n",
07a9ce0e702520 Luca Porzio 2021-02-15 826 mmc_hostname(card->host), err);
07a9ce0e702520 Luca Porzio 2021-02-15 827 err = 0;
07a9ce0e702520 Luca Porzio 2021-02-15 828 }
07a9ce0e702520 Luca Porzio 2021-02-15 829 }
"err not set on else path"
07a9ce0e702520 Luca Porzio 2021-02-15 830
07a9ce0e702520 Luca Porzio 2021-02-15 831 /*
07a9ce0e702520 Luca Porzio 2021-02-15 832 * In some cases (e.g. RPMB or mmc_test), the Command Queue must be
07a9ce0e702520 Luca Porzio 2021-02-15 833 * disabled for a time, so a flag is needed to indicate to re-enable the
07a9ce0e702520 Luca Porzio 2021-02-15 834 * Command Queue.
07a9ce0e702520 Luca Porzio 2021-02-15 835 */
07a9ce0e702520 Luca Porzio 2021-02-15 836 card->reenable_cmdq = card->ext_csd.cmdq_en;
07a9ce0e702520 Luca Porzio 2021-02-15 837
07a9ce0e702520 Luca Porzio 2021-02-15 838 /* Enable/Disable Host CQE */
07a9ce0e702520 Luca Porzio 2021-02-15 839 if (!card->force_disable_cmdq) {
07a9ce0e702520 Luca Porzio 2021-02-15 840
07a9ce0e702520 Luca Porzio 2021-02-15 841 if (host->cqe_ops && !host->cqe_enabled) {
07a9ce0e702520 Luca Porzio 2021-02-15 842 err = host->cqe_ops->cqe_enable(host, card);
07a9ce0e702520 Luca Porzio 2021-02-15 843 if (!err) {
07a9ce0e702520 Luca Porzio 2021-02-15 844 host->cqe_enabled = true;
07a9ce0e702520 Luca Porzio 2021-02-15 845
07a9ce0e702520 Luca Porzio 2021-02-15 846 if (card->ext_csd.cmdq_en) {
07a9ce0e702520 Luca Porzio 2021-02-15 847 pr_info("%s: Command Queue Engine enabled\n",
07a9ce0e702520 Luca Porzio 2021-02-15 848 mmc_hostname(host));
07a9ce0e702520 Luca Porzio 2021-02-15 849 } else {
07a9ce0e702520 Luca Porzio 2021-02-15 850 host->hsq_enabled = true;
07a9ce0e702520 Luca Porzio 2021-02-15 851 pr_info("%s: Host Software Queue enabled\n",
07a9ce0e702520 Luca Porzio 2021-02-15 852 mmc_hostname(host));
07a9ce0e702520 Luca Porzio 2021-02-15 853 }
07a9ce0e702520 Luca Porzio 2021-02-15 854 }
07a9ce0e702520 Luca Porzio 2021-02-15 855 }
"err" not set on this else path either.
07a9ce0e702520 Luca Porzio 2021-02-15 856
07a9ce0e702520 Luca Porzio 2021-02-15 857 } else {
07a9ce0e702520 Luca Porzio 2021-02-15 858
07a9ce0e702520 Luca Porzio 2021-02-15 859 if (host->cqe_enabled) {
07a9ce0e702520 Luca Porzio 2021-02-15 860 host->cqe_ops->cqe_disable(host);
07a9ce0e702520 Luca Porzio 2021-02-15 861 host->cqe_enabled = false;
07a9ce0e702520 Luca Porzio 2021-02-15 862 pr_info("%s: Command Queue Engine disabled\n",
07a9ce0e702520 Luca Porzio 2021-02-15 863 mmc_hostname(host));
07a9ce0e702520 Luca Porzio 2021-02-15 864 }
07a9ce0e702520 Luca Porzio 2021-02-15 865
07a9ce0e702520 Luca Porzio 2021-02-15 866 host->hsq_enabled = false;
07a9ce0e702520 Luca Porzio 2021-02-15 867 err = 0;
07a9ce0e702520 Luca Porzio 2021-02-15 868 }
07a9ce0e702520 Luca Porzio 2021-02-15 869
07a9ce0e702520 Luca Porzio 2021-02-15 @870 return err;
07a9ce0e702520 Luca Porzio 2021-02-15 871 }
07a9ce0e702520 Luca Porzio 2021-02-15 872
07a9ce0e702520 Luca Porzio 2021-02-15 873
07a9ce0e702520 Luca Porzio 2021-02-15 874 static ssize_t cmdq_en_show(struct device *dev, struct device_attribute *attr, char *buf)
07a9ce0e702520 Luca Porzio 2021-02-15 875 {
07a9ce0e702520 Luca Porzio 2021-02-15 876 struct mmc_card *card = mmc_dev_to_card(dev);
07a9ce0e702520 Luca Porzio 2021-02-15 877
07a9ce0e702520 Luca Porzio 2021-02-15 878 return sprintf(buf, "%d\n", card->ext_csd.cmdq_en);
07a9ce0e702520 Luca Porzio 2021-02-15 879 }
07a9ce0e702520 Luca Porzio 2021-02-15 880
07a9ce0e702520 Luca Porzio 2021-02-15 881 static ssize_t cmdq_en_store(struct device *dev, struct device_attribute *attr,
07a9ce0e702520 Luca Porzio 2021-02-15 882 const char *buf, size_t count)
07a9ce0e702520 Luca Porzio 2021-02-15 883 {
07a9ce0e702520 Luca Porzio 2021-02-15 884 struct mmc_card *card = mmc_dev_to_card(dev);
07a9ce0e702520 Luca Porzio 2021-02-15 @885 struct mmc_host *host = card->host;
^^^^^^^^^^
Dereferences "card"
07a9ce0e702520 Luca Porzio 2021-02-15 886 unsigned long enable;
07a9ce0e702520 Luca Porzio 2021-02-15 887 int err;
07a9ce0e702520 Luca Porzio 2021-02-15 888
07a9ce0e702520 Luca Porzio 2021-02-15 @889 if (!card || kstrtoul(buf, 0, &enable))
^^^^^
Checked too late.
07a9ce0e702520 Luca Porzio 2021-02-15 890 return -EINVAL;
07a9ce0e702520 Luca Porzio 2021-02-15 891 if (!card->ext_csd.cmdq_support)
07a9ce0e702520 Luca Porzio 2021-02-15 892 return -EOPNOTSUPP;
07a9ce0e702520 Luca Porzio 2021-02-15 893
07a9ce0e702520 Luca Porzio 2021-02-15 894 enable = !!enable;
07a9ce0e702520 Luca Porzio 2021-02-15 895 if (enable == card->ext_csd.cmdq_en)
07a9ce0e702520 Luca Porzio 2021-02-15 896 return count;
07a9ce0e702520 Luca Porzio 2021-02-15 897
07a9ce0e702520 Luca Porzio 2021-02-15 898 mmc_get_card(card, NULL);
07a9ce0e702520 Luca Porzio 2021-02-15 899 card->force_disable_cmdq = !enable;
07a9ce0e702520 Luca Porzio 2021-02-15 900 err = mmc_cmdq_setup(host, card);
07a9ce0e702520 Luca Porzio 2021-02-15 901 mmc_put_card(card, NULL);
07a9ce0e702520 Luca Porzio 2021-02-15 902
07a9ce0e702520 Luca Porzio 2021-02-15 903 if (err)
07a9ce0e702520 Luca Porzio 2021-02-15 904 return err;
07a9ce0e702520 Luca Porzio 2021-02-15 905 else
07a9ce0e702520 Luca Porzio 2021-02-15 906 return count;
07a9ce0e702520 Luca Porzio 2021-02-15 907 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[asoc:for-5.12 107/117] sound/soc/codecs/lpass-rx-macro.c:1476 rx_macro_int_dem_inp_mux_put() error: uninitialized symbol 'look_ahead_dly_reg'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.12
head: debc71f26cdbd45798c63b0dcdabdea93d2f6870
commit: 4f692926f562ff48abfcca6b16f36ff8d57473b6 [107/117] ASoC: codecs: lpass-rx-macro: add dapm widgets and route
config: x86_64-randconfig-m001-20210215 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
sound/soc/codecs/lpass-rx-macro.c:1476 rx_macro_int_dem_inp_mux_put() error: uninitialized symbol 'look_ahead_dly_reg'.
sound/soc/codecs/lpass-rx-macro.c:2187 rx_macro_hd2_control() error: uninitialized symbol 'hd2_enable_reg'.
sound/soc/codecs/lpass-rx-macro.c:2188 rx_macro_hd2_control() error: uninitialized symbol 'hd2_scale_reg'.
sound/soc/codecs/lpass-rx-macro.c:2655 rx_macro_enable_echo() error: uninitialized symbol 'ec_tx'.
Old smatch warnings:
sound/soc/codecs/lpass-rx-macro.c:1480 rx_macro_int_dem_inp_mux_put() error: uninitialized symbol 'look_ahead_dly_reg'.
sound/soc/codecs/lpass-rx-macro.c:2197 rx_macro_hd2_control() error: uninitialized symbol 'hd2_scale_reg'.
vim +/look_ahead_dly_reg +1476 sound/soc/codecs/lpass-rx-macro.c
4f692926f562ff Srinivas Kandagatla 2021-02-11 1458 static int rx_macro_int_dem_inp_mux_put(struct snd_kcontrol *kcontrol,
4f692926f562ff Srinivas Kandagatla 2021-02-11 1459 struct snd_ctl_elem_value *ucontrol)
4f692926f562ff Srinivas Kandagatla 2021-02-11 1460 {
4f692926f562ff Srinivas Kandagatla 2021-02-11 1461 struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_widget(kcontrol);
4f692926f562ff Srinivas Kandagatla 2021-02-11 1462 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm);
4f692926f562ff Srinivas Kandagatla 2021-02-11 1463 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
4f692926f562ff Srinivas Kandagatla 2021-02-11 1464 unsigned short look_ahead_dly_reg;
4f692926f562ff Srinivas Kandagatla 2021-02-11 1465 unsigned int val;
4f692926f562ff Srinivas Kandagatla 2021-02-11 1466
4f692926f562ff Srinivas Kandagatla 2021-02-11 1467 val = ucontrol->value.enumerated.item[0];
4f692926f562ff Srinivas Kandagatla 2021-02-11 1468
4f692926f562ff Srinivas Kandagatla 2021-02-11 1469 if (e->reg == CDC_RX_RX0_RX_PATH_CFG1)
4f692926f562ff Srinivas Kandagatla 2021-02-11 1470 look_ahead_dly_reg = CDC_RX_RX0_RX_PATH_CFG0;
4f692926f562ff Srinivas Kandagatla 2021-02-11 1471 else if (e->reg == CDC_RX_RX1_RX_PATH_CFG1)
4f692926f562ff Srinivas Kandagatla 2021-02-11 1472 look_ahead_dly_reg = CDC_RX_RX1_RX_PATH_CFG0;
Not initialized on else path.
4f692926f562ff Srinivas Kandagatla 2021-02-11 1473
4f692926f562ff Srinivas Kandagatla 2021-02-11 1474 /* Set Look Ahead Delay */
4f692926f562ff Srinivas Kandagatla 2021-02-11 1475 if (val)
4f692926f562ff Srinivas Kandagatla 2021-02-11 @1476 snd_soc_component_update_bits(component, look_ahead_dly_reg,
4f692926f562ff Srinivas Kandagatla 2021-02-11 1477 CDC_RX_DLY_ZN_EN_MASK,
4f692926f562ff Srinivas Kandagatla 2021-02-11 1478 CDC_RX_DLY_ZN_ENABLE);
4f692926f562ff Srinivas Kandagatla 2021-02-11 1479 else
4f692926f562ff Srinivas Kandagatla 2021-02-11 1480 snd_soc_component_update_bits(component, look_ahead_dly_reg,
4f692926f562ff Srinivas Kandagatla 2021-02-11 1481 CDC_RX_DLY_ZN_EN_MASK, 0);
4f692926f562ff Srinivas Kandagatla 2021-02-11 1482 /* Set DEM INP Select */
4f692926f562ff Srinivas Kandagatla 2021-02-11 1483 return snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
4f692926f562ff Srinivas Kandagatla 2021-02-11 1484 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v3] usb: typec: tcpm: Export partner Source Capabilities
by Dan Carpenter
Hi Kyle,
url: https://github.com/0day-ci/linux/commits/Kyle-Tso/usb-typec-tcpm-Export-p...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: i386-randconfig-m021-20210214 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/usb/typec/tcpm/tcpm.c:5770 tcpm_get_partner_src_caps() warn: variable dereferenced before check 'src_pdo' (see line 5769)
vim +/src_pdo +5770 drivers/usb/typec/tcpm/tcpm.c
bfd31a180a3d55 Kyle Tso 2021-02-14 5759 int tcpm_get_partner_src_caps(struct tcpm_port *port, u32 **src_pdo)
bfd31a180a3d55 Kyle Tso 2021-02-14 5760 {
bfd31a180a3d55 Kyle Tso 2021-02-14 5761 unsigned int nr_pdo;
bfd31a180a3d55 Kyle Tso 2021-02-14 5762
bfd31a180a3d55 Kyle Tso 2021-02-14 5763 mutex_lock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14 5764 if (port->nr_source_caps == 0) {
bfd31a180a3d55 Kyle Tso 2021-02-14 5765 mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14 5766 return -ENODATA;
bfd31a180a3d55 Kyle Tso 2021-02-14 5767 }
bfd31a180a3d55 Kyle Tso 2021-02-14 5768
bfd31a180a3d55 Kyle Tso 2021-02-14 @5769 *src_pdo = kcalloc(port->nr_source_caps, sizeof(u32), GFP_KERNEL);
bfd31a180a3d55 Kyle Tso 2021-02-14 @5770 if (!src_pdo) {
Typo. Missing * char.
bfd31a180a3d55 Kyle Tso 2021-02-14 5771 mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14 5772 return -ENOMEM;
bfd31a180a3d55 Kyle Tso 2021-02-14 5773 }
bfd31a180a3d55 Kyle Tso 2021-02-14 5774
bfd31a180a3d55 Kyle Tso 2021-02-14 5775 nr_pdo = tcpm_copy_pdos(*src_pdo, port->source_caps,
bfd31a180a3d55 Kyle Tso 2021-02-14 5776 port->nr_source_caps);
bfd31a180a3d55 Kyle Tso 2021-02-14 5777 mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14 5778 return nr_pdo;
bfd31a180a3d55 Kyle Tso 2021-02-14 5779 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months