LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND
@ 2019-05-10  3:00 YueHaibing
  2019-05-10 12:26 ` Andrew Lunn
  2019-05-10 22:07 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-05-10  3:00 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem
  Cc: linux-kernel, netdev, YueHaibing

Fix gcc build error:

net/dsa/tag_brcm.c:211:16: error: brcm_prepend_netdev_ops undeclared here (not in a function); did you mean brcm_netdev_ops?
 DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
                ^
./include/net/dsa.h:708:10: note: in definition of macro DSA_TAG_DRIVER
  .ops = &__ops,       \
          ^~~~~
./include/net/dsa.h:701:36: warning: dsa_tag_driver_brcm_prepend_netdev_ops defined but not used [-Wunused-variable]
 #define DSA_TAG_DRIVER_NAME(__ops) dsa_tag_driver ## _ ## __ops
                                    ^
./include/net/dsa.h:707:30: note: in expansion of macro DSA_TAG_DRIVER_NAME
 static struct dsa_tag_driver DSA_TAG_DRIVER_NAME(__ops) = {  \
                              ^~~~~~~~~~~~~~~~~~~
net/dsa/tag_brcm.c:211:1: note: in expansion of macro DSA_TAG_DRIVER
 DSA_TAG_DRIVER(brcm_prepend_netdev_ops);

Like the CONFIG_NET_DSA_TAG_BRCM case,
brcm_prepend_netdev_ops and DSA_TAG_PROTO_BRCM_PREPEND
should be wrappeed by CONFIG_NET_DSA_TAG_BRCM_PREPEND.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: b74b70c44986 ("net: dsa: Support prepended Broadcom tag")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/dsa/tag_brcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index d52db5f..9c31141 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -206,10 +206,10 @@ static const struct dsa_device_ops brcm_prepend_netdev_ops = {
 	.rcv	= brcm_tag_rcv_prepend,
 	.overhead = BRCM_TAG_LEN,
 };
-#endif
 
 DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
 MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM_PREPEND);
+#endif
 
 static struct dsa_tag_driver *dsa_tag_driver_array[] =	{
 #if IS_ENABLED(CONFIG_NET_DSA_TAG_BRCM)
-- 
2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND
  2019-05-10  3:00 [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND YueHaibing
@ 2019-05-10 12:26 ` Andrew Lunn
  2019-05-10 22:07 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-05-10 12:26 UTC (permalink / raw)
  To: YueHaibing; +Cc: vivien.didelot, f.fainelli, davem, linux-kernel, netdev

On Fri, May 10, 2019 at 11:00:28AM +0800, YueHaibing wrote:
> Fix gcc build error:
> 
> net/dsa/tag_brcm.c:211:16: error: brcm_prepend_netdev_ops undeclared here (not in a function); did you mean brcm_netdev_ops?
>  DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
>                 ^
> ./include/net/dsa.h:708:10: note: in definition of macro DSA_TAG_DRIVER
>   .ops = &__ops,       \
>           ^~~~~
> ./include/net/dsa.h:701:36: warning: dsa_tag_driver_brcm_prepend_netdev_ops defined but not used [-Wunused-variable]
>  #define DSA_TAG_DRIVER_NAME(__ops) dsa_tag_driver ## _ ## __ops
>                                     ^
> ./include/net/dsa.h:707:30: note: in expansion of macro DSA_TAG_DRIVER_NAME
>  static struct dsa_tag_driver DSA_TAG_DRIVER_NAME(__ops) = {  \
>                               ^~~~~~~~~~~~~~~~~~~
> net/dsa/tag_brcm.c:211:1: note: in expansion of macro DSA_TAG_DRIVER
>  DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
> 
> Like the CONFIG_NET_DSA_TAG_BRCM case,
> brcm_prepend_netdev_ops and DSA_TAG_PROTO_BRCM_PREPEND
> should be wrappeed by CONFIG_NET_DSA_TAG_BRCM_PREPEND.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: b74b70c44986 ("net: dsa: Support prepended Broadcom tag")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND
  2019-05-10  3:00 [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND YueHaibing
  2019-05-10 12:26 ` Andrew Lunn
@ 2019-05-10 22:07 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-05-10 22:07 UTC (permalink / raw)
  To: yuehaibing; +Cc: andrew, vivien.didelot, f.fainelli, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Fri, 10 May 2019 11:00:28 +0800

> Fix gcc build error:
> 
> net/dsa/tag_brcm.c:211:16: error: brcm_prepend_netdev_ops undeclared here (not in a function); did you mean brcm_netdev_ops?
>  DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
>                 ^
> ./include/net/dsa.h:708:10: note: in definition of macro DSA_TAG_DRIVER
>   .ops = &__ops,       \
>           ^~~~~
> ./include/net/dsa.h:701:36: warning: dsa_tag_driver_brcm_prepend_netdev_ops defined but not used [-Wunused-variable]
>  #define DSA_TAG_DRIVER_NAME(__ops) dsa_tag_driver ## _ ## __ops
>                                     ^
> ./include/net/dsa.h:707:30: note: in expansion of macro DSA_TAG_DRIVER_NAME
>  static struct dsa_tag_driver DSA_TAG_DRIVER_NAME(__ops) = {  \
>                               ^~~~~~~~~~~~~~~~~~~
> net/dsa/tag_brcm.c:211:1: note: in expansion of macro DSA_TAG_DRIVER
>  DSA_TAG_DRIVER(brcm_prepend_netdev_ops);
> 
> Like the CONFIG_NET_DSA_TAG_BRCM case,
> brcm_prepend_netdev_ops and DSA_TAG_PROTO_BRCM_PREPEND
> should be wrappeed by CONFIG_NET_DSA_TAG_BRCM_PREPEND.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: b74b70c44986 ("net: dsa: Support prepended Broadcom tag")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-10 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10  3:00 [PATCH] dsa: tag_brcm: Fix build error without CONFIG_NET_DSA_TAG_BRCM_PREPEND YueHaibing
2019-05-10 12:26 ` Andrew Lunn
2019-05-10 22:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).