From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org, Yang Yingliang <yangyingliang@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:openEuler-1.0-LTS 18302/22054] mm/share_pool.c:837:29: sparse: sparse: incompatible types for operation (<=):
Date: Tue, 9 Apr 2024 07:49:36 +0800 [thread overview]
Message-ID: <202404090717.XitFSfCo-lkp@intel.com> (raw)
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 1ed85cbd67db3ccd721e15f7459154e8daec22a8
commit: 0f0c3021514f52310056c32406b4b760fc9a7e6e [18302/22054] share_pool: Apply sp_group_id_by_pid() to multi-group-mode
config: arm64-randconfig-r111-20240331 (https://download.01.org/0day-ci/archive/20240409/202404090717.XitFSfCo-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240409/202404090717.XitFSfCo-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404090717.XitFSfCo-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> mm/share_pool.c:837:29: sparse: sparse: incompatible types for operation (<=):
mm/share_pool.c:837:29: sparse: int *num
mm/share_pool.c:837:29: sparse: int
mm/share_pool.c:1628:9: sparse: sparse: undefined identifier 'sysctl_compaction_handler'
mm/share_pool.c: In function 'sp_group_id_by_pid':
mm/share_pool.c:837:29: warning: ordered comparison of pointer with integer zero [-Wextra]
837 | if (!spg_ids || num <= 0)
| ^~
mm/share_pool.c: In function 'sp_compact_nodes':
mm/share_pool.c:1628:9: error: implicit declaration of function 'sysctl_compaction_handler' [-Werror=implicit-function-declaration]
1628 | sysctl_compaction_handler(NULL, 1, NULL, NULL, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In function 'vmalloc_area_clr_flag',
inlined from 'sp_make_share_k2u' at mm/share_pool.c:2550:8:
mm/share_pool.c:2396:18: warning: 'spa' may be used uninitialized [-Wmaybe-uninitialized]
2396 | spa->kva = 0;
| ~~~~~~~~~^~~
mm/share_pool.c: In function 'sp_make_share_k2u':
mm/share_pool.c:2429:25: note: 'spa' was declared here
2429 | struct sp_area *spa;
| ^~~
mm/share_pool.c:2562:16: warning: 'uva' may be used uninitialized [-Wmaybe-uninitialized]
2562 | return uva;
| ^~~
mm/share_pool.c:2427:15: note: 'uva' was declared here
2427 | void *uva;
| ^~~
mm/share_pool.c: In function 'sp_group_post_exit':
mm/share_pool.c:3863:37: warning: 'alloc_size' may be used uninitialized [-Wmaybe-uninitialized]
3863 | if (alloc_size != 0 || k2u_size != 0)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
mm/share_pool.c:3831:14: note: 'alloc_size' was declared here
3831 | long alloc_size, k2u_size;
| ^~~~~~~~~~
mm/share_pool.c:3863:37: warning: 'k2u_size' may be used uninitialized [-Wmaybe-uninitialized]
3863 | if (alloc_size != 0 || k2u_size != 0)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
mm/share_pool.c:3831:26: note: 'k2u_size' was declared here
3831 | long alloc_size, k2u_size;
| ^~~~~~~~
cc1: some warnings being treated as errors
vim +837 mm/share_pool.c
815
816 /**
817 * sp_group_id_by_pid() - Get the sp_group ID array of a process.
818 * @pid: pid of target process.
819 * @spg_ids point to an array to save the group ids the process belongs to
820 * @num input the spg_ids array size; output the spg number of the process
821 *
822 * Return:
823 * >0 - the sp_group ID.
824 * -ENODEV - target process doesn't belong to any sp_group.
825 * -EINVAL - spg_ids or num is NULL.
826 * -E2BIG - the num of groups process belongs to is larger than *num
827 */
828 int sp_group_id_by_pid(int pid, int *spg_ids, int *num)
829 {
830 int ret = 0;
831 struct sp_group_node *node;
832 struct sp_group_master *master = NULL;
833 struct task_struct *tsk;
834
835 check_interrupt_context();
836
> 837 if (!spg_ids || num <= 0)
838 return -EINVAL;
839
840 ret = get_task(pid, &tsk);
841 if (ret)
842 return ret;
843
844 down_read(&sp_group_sem);
845 task_lock(tsk);
846 if (tsk->mm)
847 master = tsk->mm->sp_group_master;
848 task_unlock(tsk);
849
850 if (!master) {
851 ret = -ENODEV;
852 goto out_up_read;
853 }
854
855 if (!master->count) {
856 ret = -ENODEV;
857 goto out_up_read;
858 }
859 if ((unsigned int)*num < master->count) {
860 ret = -E2BIG;
861 goto out_up_read;
862 }
863 *num = master->count;
864
865 list_for_each_entry(node, &master->node_list, group_node)
866 *(spg_ids++) = node->spg->id;
867
868 out_up_read:
869 up_read(&sp_group_sem);
870 put_task_struct(tsk);
871 return ret;
872 }
873 EXPORT_SYMBOL_GPL(sp_group_id_by_pid);
874
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-08 23:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404090717.XitFSfCo-lkp@intel.com \
--to=lkp@intel.com \
--cc=kernel@openeuler.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.