diff mbox series

md: remove unnecessary unlikely()

Message ID 1553668297-82871-1-git-send-email-zhengbin13@huawei.com (mailing list archive)
State Rejected, archived
Delegated to: Mike Snitzer
Headers show
Series md: remove unnecessary unlikely() | expand

Commit Message

Zheng Bin March 27, 2019, 6:31 a.m. UTC
BUG_ON() already contains an unlikely(), there is no need for another one.

Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/md/dm-integrity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Mike Snitzer March 27, 2019, 1:19 p.m. UTC | #1
On Wed, Mar 27 2019 at  2:31am -0400,
zhengbin <zhengbin13@huawei.com> wrote:

> BUG_ON() already contains an unlikely(), there is no need for another one.
> 
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  drivers/md/dm-integrity.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
> index d57d997..7f03638 100644
> --- a/drivers/md/dm-integrity.c
> +++ b/drivers/md/dm-integrity.c
> @@ -1959,7 +1959,7 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
> 
>  			if (journal_entry_is_unused(je))
>  				continue;
> -			BUG_ON(unlikely(journal_entry_is_inprogress(je)) && !from_replay);
> +			BUG_ON(journal_entry_is_inprogress(je) && !from_replay);
>  			sec = journal_entry_get_sector(je);
>  			if (unlikely(from_replay)) {
>  				if (unlikely(sec & (unsigned)(ic->sectors_per_block - 1))) {
> @@ -1974,7 +1974,7 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
>  				sector_t sec2, area2, offset2;
>  				if (journal_entry_is_unused(je2))
>  					break;
> -				BUG_ON(unlikely(journal_entry_is_inprogress(je2)) && !from_replay);
> +				BUG_ON(journal_entry_is_inprogress(je2) && !from_replay);
>  				sec2 = journal_entry_get_sector(je2);
>  				get_area_and_offset(ic, sec2, &area2, &offset2);
>  				if (area2 != area || offset2 != offset + ((k - j) << ic->sb->log2_sectors_per_block))
> --
> 2.7.4

Last time another janitor came through with this suggestion Mikulas
responded with:

https://www.redhat.com/archives/dm-devel/2018-September/msg00088.html

SO thanks, but no thanks.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index d57d997..7f03638 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -1959,7 +1959,7 @@  static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,

 			if (journal_entry_is_unused(je))
 				continue;
-			BUG_ON(unlikely(journal_entry_is_inprogress(je)) && !from_replay);
+			BUG_ON(journal_entry_is_inprogress(je) && !from_replay);
 			sec = journal_entry_get_sector(je);
 			if (unlikely(from_replay)) {
 				if (unlikely(sec & (unsigned)(ic->sectors_per_block - 1))) {
@@ -1974,7 +1974,7 @@  static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
 				sector_t sec2, area2, offset2;
 				if (journal_entry_is_unused(je2))
 					break;
-				BUG_ON(unlikely(journal_entry_is_inprogress(je2)) && !from_replay);
+				BUG_ON(journal_entry_is_inprogress(je2) && !from_replay);
 				sec2 = journal_entry_get_sector(je2);
 				get_area_and_offset(ic, sec2, &area2, &offset2);
 				if (area2 != area || offset2 != offset + ((k - j) << ic->sb->log2_sectors_per_block))