Skip to content

Commit 5c83cc6

Browse files
lsgunthwesleywesley
authored andcommitted
ntb_hw_switchtec: Check for alignment of the buffer in mw_set_trans()
use Marco IS_ALIGNED and BIT_ULL in mw_set_trans() while alignment check of the buffer
1 parent 289c7ed commit 5c83cc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ntb_hw_switchtec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int idx,
377377
if (xlate_pos < 12)
378378
return -EINVAL;
379379

380-
if (addr & ((1 << xlate_pos) - 1)) {
380+
if (!IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
381381
/*
382382
* In certain circumstances we can get a buffer that is
383383
* not aligned to its size. (Most of the time

0 commit comments

Comments
 (0)