Skip to content

Comments

More improvments to sbi_fifo#106

Merged
atishp04 merged 2 commits intoriscv-software-src:masterfrom
avpatel:fifo_cosmetics
Apr 3, 2019
Merged

More improvments to sbi_fifo#106
atishp04 merged 2 commits intoriscv-software-src:masterfrom
avpatel:fifo_cosmetics

Conversation

@avpatel
Copy link
Collaborator

@avpatel avpatel commented Apr 3, 2019

No description provided.

@avpatel avpatel requested a review from atishp04 April 3, 2019 05:10
@avpatel avpatel force-pushed the fifo_cosmetics branch 2 times, most recently from 504af1f to 232afe4 Compare April 3, 2019 07:04
@gurjeet
Copy link

gurjeet commented Apr 3, 2019

That's quite a significant patch to be deemed "cosmetic". I hope when it gets committed, it is accompanied by a better commit message/description of the changes in the code.

@avpatel
Copy link
Collaborator Author

avpatel commented Apr 3, 2019

Sorry about the misleading title. I will change the subject of PR and first commit of this PR.

@avpatel avpatel changed the title Cosmetic changes in sbi_fifo More improvments to sbi_fifo Apr 3, 2019
avpatel added 2 commits April 3, 2019 13:57
This patch does following improvements to sbi_fifo:
1. Use valid SBI_Exxxx error codes instead of -1
2. The sbi_fifo_is_full() and sbi_fifo_is_empty() did
   not acquire qlock before accessing head and tail
   hence fixed it
3. Added avail member for ease in debugging and simplifying
   head/tail updates.

Due to above changes size of sbi_fifo changes from 48 bytes
to 56 bytes.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
This patch reduces memory consumed by struct sbi_fifo by droping
redundant "head" member and using u16 in-place of "unsigned long".

Signed-off-by: Anup Patel <anup.patel@wdc.com>
@atishp04 atishp04 merged commit 3fbe233 into riscv-software-src:master Apr 3, 2019
@avpatel avpatel deleted the fifo_cosmetics branch April 4, 2019 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants