ptp: add stub function for ptp_get_msgtype()

Message ID 20200927080150.8479-1-yangbo.lu@nxp.com
State New
Headers show
Series
  • ptp: add stub function for ptp_get_msgtype()
Related show

Commit Message

Y.b. Lu Sept. 27, 2020, 8:01 a.m.
Added the missing stub function for ptp_get_msgtype().

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 036c508ba95e ("ptp: Add generic ptp message type function")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 include/linux/ptp_classify.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Randy Dunlap Sept. 27, 2020, 4:14 p.m. | #1
On 9/27/20 1:01 AM, Yangbo Lu wrote:
> Added the missing stub function for ptp_get_msgtype().

> 

> Reported-by: Randy Dunlap <rdunlap@infradead.org>

> Fixes: 036c508ba95e ("ptp: Add generic ptp message type function")

> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>


Yes, that works. Thanks.

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested



> ---

>  include/linux/ptp_classify.h | 8 ++++++++

>  1 file changed, 8 insertions(+)

> 

> diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h

> index 8437307..c6487b7 100644

> --- a/include/linux/ptp_classify.h

> +++ b/include/linux/ptp_classify.h

> @@ -134,5 +134,13 @@ static inline struct ptp_header *ptp_parse_header(struct sk_buff *skb,

>  {

>  	return NULL;

>  }

> +static inline u8 ptp_get_msgtype(const struct ptp_header *hdr,

> +				 unsigned int type)

> +{

> +	/* The return is meaningless. The stub function would not be

> +	 * executed since no available header from ptp_parse_header.

> +	 */

> +	return 0;

> +}

>  #endif

>  #endif /* _PTP_CLASSIFY_H_ */

> 



-- 
~Randy
David Miller Sept. 27, 2020, 8:30 p.m. | #2
From: Yangbo Lu <yangbo.lu@nxp.com>

Date: Sun, 27 Sep 2020 16:01:50 +0800

> Added the missing stub function for ptp_get_msgtype().

> 

> Reported-by: Randy Dunlap <rdunlap@infradead.org>

> Fixes: 036c508ba95e ("ptp: Add generic ptp message type function")

> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>


Applied to net-next, thanks.
Kurt Kanzenbach Sept. 28, 2020, 5:46 a.m. | #3
On Sun Sep 27 2020, Yangbo Lu wrote:
> Added the missing stub function for ptp_get_msgtype().

>

> Reported-by: Randy Dunlap <rdunlap@infradead.org>

> Fixes: 036c508ba95e ("ptp: Add generic ptp message type function")

> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>


Oh, my bad. Thanks for fixing it.

Thanks,
Kurt

Patch

diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index 8437307..c6487b7 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -134,5 +134,13 @@  static inline struct ptp_header *ptp_parse_header(struct sk_buff *skb,
 {
 	return NULL;
 }
+static inline u8 ptp_get_msgtype(const struct ptp_header *hdr,
+				 unsigned int type)
+{
+	/* The return is meaningless. The stub function would not be
+	 * executed since no available header from ptp_parse_header.
+	 */
+	return 0;
+}
 #endif
 #endif /* _PTP_CLASSIFY_H_ */