[PATCH] NTB: correct ntb_peer_spad_read for case when callback is not supplied.

4 views
Skip to first unread message

Steven Wahl

unread,
Dec 8, 2016, 12:02:30 PM12/8/16
to linu...@googlegroups.com

Signed-off-by: Steve Wahl <Steve...@dell.com>
---
include/linux/ntb.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/linux/ntb.h b/include/linux/ntb.h
index 6f47562..816bd98 100644
--- a/include/linux/ntb.h
+++ b/include/linux/ntb.h
@@ -968,6 +968,9 @@ static inline int ntb_peer_spad_addr(struct ntb_dev *ntb, int idx,
*/
static inline u32 ntb_peer_spad_read(struct ntb_dev *ntb, int idx)
{
+ if (!ntb->ops->peer_spad_read)
+ return 0;
+
return ntb->ops->peer_spad_read(ntb, idx);
}

--
2.7.4

Allen Hubbe

unread,
Dec 8, 2016, 12:17:17 PM12/8/16
to Wahl, Steve, linu...@googlegroups.com
From: Steven Wahl
>
> Signed-off-by: Steve Wahl <Steve...@dell.com>

The only thing lacking here is a commit comment, but the change is self-explanatory. Thanks!

Acked-by: Allen Hubbe <Allen...@dell.com>

Jon Mason

unread,
Dec 21, 2016, 11:40:44 AM12/21/16
to Allen Hubbe, Wahl, Steve, linu...@googlegroups.com
On Thu, Dec 08, 2016 at 12:16:57PM -0500, Allen Hubbe wrote:
> From: Steven Wahl
> >
> > Signed-off-by: Steve Wahl <Steve...@dell.com>
>
> The only thing lacking here is a commit comment, but the change is self-explanatory. Thanks!
>
> Acked-by: Allen Hubbe <Allen...@dell.com>

This didn't apply cleanly for some reason. I hand applied it, as it
was a simple patch and duplicated the title into the body of the
commit.

Thanks,
Jon

>
> > ---
> > include/linux/ntb.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/include/linux/ntb.h b/include/linux/ntb.h
> > index 6f47562..816bd98 100644
> > --- a/include/linux/ntb.h
> > +++ b/include/linux/ntb.h
> > @@ -968,6 +968,9 @@ static inline int ntb_peer_spad_addr(struct ntb_dev *ntb, int idx,
> > */
> > static inline u32 ntb_peer_spad_read(struct ntb_dev *ntb, int idx)
> > {
> > + if (!ntb->ops->peer_spad_read)
> > + return 0;
> > +
> > return ntb->ops->peer_spad_read(ntb, idx);
> > }
> >
> > --
> > 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+...@googlegroups.com.
> To post to this group, send email to linu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/002101d25176%24e14ac450%24a3e04cf0%24%40dell.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages