mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
NTB: amd: Silence shift wrapping warning in amd_ntb_db_vector_mask()
This code triggers a Smatch warning:
drivers/ntb/hw/amd/ntb_hw_amd.c:336 amd_ntb_db_vector_mask()
warn: should '(1 << db_vector)' be a 64 bit type?
I don't think "db_vector" can be higher than 16 so this doesn't affect
runtime, but it's nice to silence the static checker warning and we
might increase "ndev->db_count" in the future.
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Shyam Sundar S K <[email protected]>
Signed-off-by: Jon Mason <[email protected]>
This commit is contained in:
parent
ff148d8ac5
commit
1e590dec3e
1 changed files with 1 additions and 1 deletions
|
|
@ -333,7 +333,7 @@ static u64 amd_ntb_db_vector_mask(struct ntb_dev *ntb, int db_vector)
|
|||
if (db_vector < 0 || db_vector > ndev->db_count)
|
||||
return 0;
|
||||
|
||||
return ntb_ndev(ntb)->db_valid_mask & (1 << db_vector);
|
||||
return ntb_ndev(ntb)->db_valid_mask & (1ULL << db_vector);
|
||||
}
|
||||
|
||||
static u64 amd_ntb_db_read(struct ntb_dev *ntb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue