From: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
To: Dan Carpenter <dan.carpenter@linaro.org>, <oe-kbuild@lists.linux.dev>
Cc: <lkp@intel.com>, <oe-kbuild-all@lists.linux.dev>,
Linux Memory Management List <linux-mm@kvack.org>,
"Rob Herring (Arm)" <robh@kernel.org>
Subject: Re: [linux-next:master 9793/10134] drivers/of/of_reserved_mem.c:463 fdt_init_reserved_mem() error: uninitialized symbol 'nomap'.
Date: Thu, 2 May 2024 13:45:59 -0700 [thread overview]
Message-ID: <17deb294-223d-4aa2-8aa1-d9e3eee929c9@quicinc.com> (raw)
In-Reply-To: <34976102-567d-4651-bf14-41b85af8735e@moroto.mountain>
On 5/2/2024 1:45 AM, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: f68868ba718e30594165879cc3020607165b0761
> commit: 2acef04ad57cab44b33001542791fc93f81cadf1 [9793/10134] of: reserved_mem: Remove the use of phandle from the reserved_mem APIs
> config: i386-randconfig-141-20240501 (https://download.01.org/0day-ci/archive/20240502/202405020127.3ncxx3EI-lkp@intel.com/config)
> compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
>
> 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>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202405020127.3ncxx3EI-lkp@intel.com/
>
> smatch warnings:
> drivers/of/of_reserved_mem.c:463 fdt_init_reserved_mem() error: uninitialized symbol 'nomap'.
>
> vim +/nomap +463 drivers/of/of_reserved_mem.c
>
> 3f0c8206644836 Marek Szyprowski 2014-02-28 430 void __init fdt_init_reserved_mem(void)
> 3f0c8206644836 Marek Szyprowski 2014-02-28 431 {
> 3f0c8206644836 Marek Szyprowski 2014-02-28 432 int i;
> ae1add247bf8c2 Mitchel Humpherys 2015-09-15 433
> ae1add247bf8c2 Mitchel Humpherys 2015-09-15 434 /* check for overlapping reserved regions */
> ae1add247bf8c2 Mitchel Humpherys 2015-09-15 435 __rmem_check_for_overlap();
> ae1add247bf8c2 Mitchel Humpherys 2015-09-15 436
> 3f0c8206644836 Marek Szyprowski 2014-02-28 437 for (i = 0; i < reserved_mem_count; i++) {
> 3f0c8206644836 Marek Szyprowski 2014-02-28 438 struct reserved_mem *rmem = &reserved_mem[i];
> 3f0c8206644836 Marek Szyprowski 2014-02-28 439 unsigned long node = rmem->fdt_node;
> 3f0c8206644836 Marek Szyprowski 2014-02-28 440 int err = 0;
> 6f1188b4ac7577 Yue Hu 2020-07-30 441 bool nomap;
> 3f0c8206644836 Marek Szyprowski 2014-02-28 442
> 3f0c8206644836 Marek Szyprowski 2014-02-28 443 if (rmem->size == 0)
> 3f0c8206644836 Marek Szyprowski 2014-02-28 444 err = __reserved_mem_alloc_size(node, rmem->name,
> 3f0c8206644836 Marek Szyprowski 2014-02-28 445 &rmem->base, &rmem->size);
> d0b8ed47e83a22 pierre Kuo 2019-02-19 446 if (err == 0) {
> d0b8ed47e83a22 pierre Kuo 2019-02-19 447 err = __reserved_mem_init_node(rmem);
> d0b8ed47e83a22 pierre Kuo 2019-02-19 448 if (err != 0 && err != -ENOENT) {
> d0b8ed47e83a22 pierre Kuo 2019-02-19 449 pr_info("node %s compatible matching fail\n",
> d0b8ed47e83a22 pierre Kuo 2019-02-19 450 rmem->name);
> 2acef04ad57cab Oreoluwa Babatunde 2024-04-22 451
> 2acef04ad57cab Oreoluwa Babatunde 2024-04-22 452 nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL;
> d0b8ed47e83a22 pierre Kuo 2019-02-19 453 if (nomap)
> 7b25995f5319ad Dong Aisheng 2021-06-11 454 memblock_clear_nomap(rmem->base, rmem->size);
> 3c6867a12a224d Dong Aisheng 2021-06-11 455 else
> 3ecc68349bbab6 Mike Rapoport 2021-11-05 456 memblock_phys_free(rmem->base,
> 3ecc68349bbab6 Mike Rapoport 2021-11-05 457 rmem->size);
> aeb9267eb6b1df Martin Liu 2023-02-10 458 } else {
> aeb9267eb6b1df Martin Liu 2023-02-10 459 phys_addr_t end = rmem->base + rmem->size - 1;
> aeb9267eb6b1df Martin Liu 2023-02-10 460 bool reusable =
> aeb9267eb6b1df Martin Liu 2023-02-10 461 (of_get_flat_dt_prop(node, "reusable", NULL)) != NULL;
> aeb9267eb6b1df Martin Liu 2023-02-10 462
> 6ee7afbabcee4d Geert Uytterhoeven 2023-02-16 @463 pr_info("%pa..%pa (%lu KiB) %s %s %s\n",
> aeb9267eb6b1df Martin Liu 2023-02-10 464 &rmem->base, &end, (unsigned long)(rmem->size / SZ_1K),
> aeb9267eb6b1df Martin Liu 2023-02-10 465 nomap ? "nomap" : "map",
> ^^^^^ ^^^^^
> This is nomap from the previous iteration through the loop. How is
> it useful?
Hi Dan,
I have uploaded a new patch which has the correct behavior
for nomap in this loop.
https://lore.kernel.org/all/20240502192403.3307277-1-quic_obabatun@quicinc.com/
Moving line 452 into the if statement was an error on my
part because I did not take note that the value was being
printed in the else statement as well.
Thank you!
Oreoluwa
prev parent reply other threads:[~2024-05-02 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 8:45 Dan Carpenter
2024-05-02 20:45 ` Oreoluwa Babatunde [this message]
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=17deb294-223d-4aa2-8aa1-d9e3eee929c9@quicinc.com \
--to=quic_obabatun@quicinc.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=robh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox