From: Alexander Fomichev Date: Tue, 16 Jul 2019 17:34:48 +0000 (+0300) Subject: ntb_hw_switchtec: make ntb_mw_set_trans() work when addr == 0 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c16c6655605f52cf2107a7c8dc0c798645351976;p=linux.git ntb_hw_switchtec: make ntb_mw_set_trans() work when addr == 0 On switchtec_ntb_mw_set_trans() call, when (only) address == 0, it acts as ntb_mw_clear_trans(). Fix this, since address == 0 and size != 0 is valid combination for setting translation. Signed-off-by: Alexander Fomichev Reviewed-by: Logan Gunthorpe Signed-off-by: Jon Mason --- diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c index f4959458d9096..86ffa716eaf22 100644 --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c @@ -306,7 +306,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx, if (rc) return rc; - if (addr == 0 || size == 0) { + if (size == 0) { if (widx < nr_direct_mw) switchtec_ntb_mw_clr_direct(sndev, widx); else