* [PATCH v2] ubifs: Fix the printing type of c->big_lpt
@ 2020-10-31 8:54 Chengsong Ke
2020-10-31 20:44 ` Richard Weinberger
2020-11-02 9:13 ` Chengsong Ke
0 siblings, 2 replies; 3+ messages in thread
From: Chengsong Ke @ 2020-10-31 8:54 UTC (permalink / raw)
To: richard, s.hauer; +Cc: linux-mtd, linux-kernel, wangfangpeng1
Ubifs uses %d to print c->big_lpt, but c->big_lpt is a variable
of type unsigned int and should be printed with %u.
Signed-off-by: Chengsong Ke <kechengsong@huawei.com>
---
fs/ubifs/debug.c | 2 +-
fs/ubifs/lpt.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index ebff43f8009c..ef1a02ee076f 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -764,7 +764,7 @@ void ubifs_dump_lpt_info(struct ubifs_info *c)
pr_err("\tnnode_sz: %d\n", c->nnode_sz);
pr_err("\tltab_sz: %d\n", c->ltab_sz);
pr_err("\tlsave_sz: %d\n", c->lsave_sz);
- pr_err("\tbig_lpt: %d\n", c->big_lpt);
+ pr_err("\tbig_lpt: %u\n", c->big_lpt);
pr_err("\tlpt_hght: %d\n", c->lpt_hght);
pr_err("\tpnode_cnt: %d\n", c->pnode_cnt);
pr_err("\tnnode_cnt: %d\n", c->nnode_cnt);
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index 6e0a153b7194..778a22bf9a92 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -851,7 +851,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
dbg_lp("lsave_sz %d", c->lsave_sz);
dbg_lp("lsave_cnt %d", c->lsave_cnt);
dbg_lp("lpt_hght %d", c->lpt_hght);
- dbg_lp("big_lpt %d", c->big_lpt);
+ dbg_lp("big_lpt %u", c->big_lpt);
dbg_lp("LPT root is at %d:%d", c->lpt_lnum, c->lpt_offs);
dbg_lp("LPT head is at %d:%d", c->nhead_lnum, c->nhead_offs);
dbg_lp("LPT ltab is at %d:%d", c->ltab_lnum, c->ltab_offs);
@@ -1824,7 +1824,7 @@ static int lpt_init_rd(struct ubifs_info *c)
dbg_lp("lsave_sz %d", c->lsave_sz);
dbg_lp("lsave_cnt %d", c->lsave_cnt);
dbg_lp("lpt_hght %d", c->lpt_hght);
- dbg_lp("big_lpt %d", c->big_lpt);
+ dbg_lp("big_lpt %u", c->big_lpt);
dbg_lp("LPT root is at %d:%d", c->lpt_lnum, c->lpt_offs);
dbg_lp("LPT head is at %d:%d", c->nhead_lnum, c->nhead_offs);
dbg_lp("LPT ltab is at %d:%d", c->ltab_lnum, c->ltab_offs);
--
2.12.3
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ubifs: Fix the printing type of c->big_lpt
2020-10-31 8:54 [PATCH v2] ubifs: Fix the printing type of c->big_lpt Chengsong Ke
@ 2020-10-31 20:44 ` Richard Weinberger
2020-11-02 9:13 ` Chengsong Ke
1 sibling, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2020-10-31 20:44 UTC (permalink / raw)
To: Chengsong Ke
Cc: Richard Weinberger, Sascha Hauer, linux-mtd, LKML, wangfangpeng1
On Sat, Oct 31, 2020 at 9:56 AM Chengsong Ke <kechengsong@huawei.com> wrote:
>
> Ubifs uses %d to print c->big_lpt, but c->big_lpt is a variable
> of type unsigned int and should be printed with %u.
Well, it is:
unsigned int big_lpt:1;
So, either 0 or 1.
Does changing it to %u silence some static checker or is there some
other problem I don't
see right now? :-)
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ubifs: Fix the printing type of c->big_lpt
2020-10-31 8:54 [PATCH v2] ubifs: Fix the printing type of c->big_lpt Chengsong Ke
2020-10-31 20:44 ` Richard Weinberger
@ 2020-11-02 9:13 ` Chengsong Ke
1 sibling, 0 replies; 3+ messages in thread
From: Chengsong Ke @ 2020-11-02 9:13 UTC (permalink / raw)
To: richard; +Cc: linux-mtd, linux-kernel, wangfangpeng1
On Sat, Oct 31, 2020 at 9:56 AM Chengsong Ke <kechengsong@huawei.com> wrote:
>
> Ubifs uses %d to print c->big_lpt, but c->big_lpt is a variable of
> type unsigned int and should be printed with %u.
>
> Well, it is:
> unsigned int big_lpt:1;
> So, either 0 or 1.
>
> Does changing it to %u silence some static checker or is there some
> other problem I don't see right now? :-)
>
> Thanks,
> //Richard
This is just a coding style issue, I found in the ubifs code. :-)
Thanks,
//Chengsong Ke
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-02 9:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 8:54 [PATCH v2] ubifs: Fix the printing type of c->big_lpt Chengsong Ke
2020-10-31 20:44 ` Richard Weinberger
2020-11-02 9:13 ` Chengsong Ke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).