Skip to content

Commit 1195079

Browse files
arndbwesleywesley
authored andcommitted
ntb_hw_switchtec: fix logic error
Newer gcc (version 7 and 8 presumably) warn about a statement mixing the << operator with logical and: drivers/ntb/hw/mscc/ntb_hw_switchtec.c: In function 'switchtec_ntb_init_sndev': drivers/ntb/hw/mscc/ntb_hw_switchtec.c:888:24: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] My interpretation here is that the author must have intended a bitmask rather than a comparison, so I'm changing the '&&' to '&', which makes a lot more sense in the context. Fixes: 1b249475275d ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent fcfeff9 commit 1195079

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
@@ -867,7 +867,7 @@ static int switchtec_ntb_init_sndev(struct switchtec_ntb *sndev)
867867
}
868868

869869
sndev->peer_partition = ffs(tpart_vec) - 1;
870-
if (!(part_map && (1 << sndev->peer_partition))) {
870+
if (!(part_map & (1 << sndev->peer_partition))) {
871871
dev_err(&sndev->stdev->dev,
872872
"ntb target partition is not NT partition\n");
873873
return -ENODEV;

0 commit comments

Comments
 (0)