lib: sign conflict in sbi_tlb_entry_process()
PATCH 1/1 lib: sign conflict in sbi_tlb_entry_process()
Compiling sbi_tlb_entry_process() with GCC 11 and -Wextra yields:
lib/sbi/sbi_tlb.c: In function ?sbi_tlb_process_count?:lib/sbi/sbi_tlb.c:206:31:
error: comparison of integer expressions of different signedness:
?u32? {aka ?unsigned int?} and ?int? [-Werror=sign-compare]
206 | if (deq_count > count)
--- lib/sbi/sbi_tlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
lib/sbi/sbi_tlb.c +3 -2
@@ -193,10 +193,11 @@ static void sbi_tlb_entry_process(struct sbi_tlb_info *tinfo) } } -static void sbi_tlb_process_count (struct sbi_scratch *scratch,int count) +static void sbi_tlb_process_count (struct sbi_scratch *scratch, +unsigned int count) {struct sbi_tlb_info tinfo; -u32 deq_count =0 ; +unsigned int deq_count =0 ;struct sbi_fifo *tlb_fifo =sbi_scratch_offset_ptr (scratch, tlb_fifo_off);
--
2.30.2
PATCH 1/1 lib: sign conflict in sbi_tlb_entry_process()
Quoted 36 lines · Heinrich Schuchardt
Compiling
sbi_tlb_entry_process()with GCC 11 and -Wextra yields:
lib/sbi/sbi_tlb.c: In function ?sbi_tlb_process_count?:lib/sbi/sbi_tlb.c:206:31:
error: comparison of integer expressions of different signedness:
?u32? {aka ?unsigned int?} and ?int? [-Werror=sign-compare]
206 | if (deq_count> count)Signed-off-by Heinrich Schuchardt <[email protected]>--- lib/sbi/sbi_tlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)lib/sbi/sbi_tlb.c +3
-3@@ -193,10 +193,11 @@ static void sbi_tlb_entry_process(struct sbi_tlb_info *tinfo) } } -static void sbi_tlb_process_count (struct sbi_scratch *scratch,int count) +static void sbi_tlb_process_count (struct sbi_scratch *scratch, +unsigned int count) {struct sbi_tlb_info tinfo; -u32 deq_count =0 ; +unsigned int deq_count =0 ;struct sbi_fifo *tlb_fifo =sbi_scratch_offset_ptr (scratch, tlb_fifo_off); --2.30.2
Quoted 4 lines
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
--
Regards,
Atish
PATCH 1/1 lib: sign conflict in sbi_tlb_entry_process()
In reply to Heinrich Schuchardt? 2021-06-21???? 21:50 +0200?Heinrich Schuchardt???
Quoted 8 lines
Compiling
sbi_tlb_entry_process()with GCC 11 and -Wextra yields:
lib/sbi/sbi_tlb.c: In function ?sbi_tlb_process_count?:lib/sbi/sbi_tlb.c:206:31:
error: comparison of integer expressions of different signedness:
?u32? {aka ?unsigned int?} and ?int? [-Werror=sign-compare] ? 206 |???????????????? if (deq_count> count)
Regards,
Xiang W
Quoted 30 lines
Signed-off-by Heinrich Schuchardt <[email protected]>---
?lib/sbi/sbi_tlb.c | 5 +++--
?1 file changed, 3 insertions(+), 2 deletions(-)lib/sbi/sbi_tlb.c +3
-2@@ -193,10 +193,11 @@ static void sbi_tlb_entry_process(struct sbi_tlb_info *tinfo) ????????} ?} -static void sbi_tlb_process_count (struct sbi_scratch *scratch,int count) +static void sbi_tlb_process_count(struct sbi_scratch *scratch, +???????????????????????????????? unsigned int count) ?{ ????????struct sbi_tlb_info tinfo; -???????u32 deq_count = 0; +???????unsigned int deq_count = 0;????????struct
sbi_fifo*tlb_fifo= ????????????????????????sbi_scratch_offset_ptr(scratch,tlb_fifo_off);--
2.30.2
Anup Patel
AppliedPATCH 1/1 lib: sign conflict in sbi_tlb_entry_process()
?On 22/06/21, 12:12 PM, "Xiang W" <[email protected]> wrote:
? 2021-06-21???? 21:50 +0200?Heinrich Schuchardt???
> Compiling sbi_tlb_entry_process() with GCC 11 and -Wextra yields:
>
> lib/sbi/sbi_tlb.c: In function ?sbi_tlb_process_count?:
> lib/sbi/sbi_tlb.c:206:31:
> error: comparison of integer expressions of different signedness:
> ?u32? {aka ?unsigned int?} and ?int? [-Werror=sign-compare]
> 206 | if (deq_count > count)
>
Applied this patch to the riscv/opensbi repo.
Regards,
Anup
Quoted 30 lines
Signed-off-by Heinrich Schuchardt <[email protected]>--- lib/sbi/sbi_tlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)lib/sbi/sbi_tlb.c +3
-2@@ -193,10 +193,11 @@ static void sbi_tlb_entry_process(struct sbi_tlb_info *tinfo) } } -static void sbi_tlb_process_count (struct sbi_scratch *scratch,int count) +static void sbi_tlb_process_count(struct sbi_scratch *scratch, +unsigned int count) {struct sbi_tlb_info tinfo; -u32 deq_count =0 ; +unsigned int deq_count =0 ; struct sbi_fifo *tlb_fifo =sbi_scratch_offset_ptr(scratch,
tlb_fifo_off);--
2.30.2