linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: Fix unused macro Argument 'x'
@ 2025-03-22  0:32 nancyenos
  2025-03-22  6:59 ` kernel test robot
  2025-03-23  2:20 ` kernel test robot
  0 siblings, 2 replies; 7+ messages in thread
From: nancyenos @ 2025-03-22  0:32 UTC (permalink / raw)
  To: outreachy @ lists . linux . dev Greg Kroah-Hartman, linux-staging,
	linux-kernel
  Cc: nancyenos

warning found by checkpath.pl

Signed-off-by: nancyenos <nicymimz@gmail.com>
---
 drivers/staging/octeon/octeon-stubs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 44cced319c11..0155f3c41657 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -8,8 +8,8 @@
 #define OCTEON_IRQ_WORKQ0 0
 #define OCTEON_IRQ_RML 0
 #define OCTEON_IRQ_TIMER1 0
-#define OCTEON_IS_MODEL(x) 0
-#define octeon_has_feature(x)	0
+#define OCTEON_IS_MODEL(x) ((void)(x), 0)
+#define octeon_has_feature(x) ((void)(x), 0)
 #define octeon_get_clock_rate()	0
 
 #define CVMX_SYNCIOBDMA		do { } while (0)
-- 
2.25.1


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

* Re: [PATCH] staging: octeon: Fix unused macro Argument 'x'
  2025-03-22  0:32 nancyenos
@ 2025-03-22  6:59 ` kernel test robot
  2025-03-23  2:20 ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-22  6:59 UTC (permalink / raw)
  To: nancyenos, outreachy @ lists . linux . dev Greg Kroah-Hartman,
	linux-staging, linux-kernel
  Cc: oe-kbuild-all, nancyenos

Hi nancyenos,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/nancyenos/staging-octeon-Fix-unused-macro-Argument-x/20250322-084136
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250322003218.14134-1-nicymimz%40gmail.com
patch subject: [PATCH] staging: octeon: Fix unused macro Argument 'x'
config: arc-randconfig-001-20250322 (https://download.01.org/0day-ci/archive/20250322/202503221402.gmXKIBsx-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250322/202503221402.gmXKIBsx-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503221402.gmXKIBsx-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet-rx.c:26:
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_check_rcv_error':
>> drivers/staging/octeon/ethernet-rx.c:67:25: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
      67 |  if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                         ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
   drivers/staging/octeon/ethernet-rx.c:67:25: note: each undeclared identifier is reported only once for each function it appears in
      67 |  if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                         ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
>> drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet-rx.c:67:6: note: in expansion of macro 'octeon_has_feature'
      67 |  if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |      ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_poll':
>> drivers/staging/octeon/ethernet-rx.c:201:22: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     201 |  if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                      ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:201:6: note: in expansion of macro 'OCTEON_IS_MODEL'
     201 |  if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |      ^~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:233:8: note: in expansion of macro 'OCTEON_IS_MODEL'
     233 |    if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |        ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c:267:26: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
     267 |   if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                          ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
>> drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet-rx.c:267:7: note: in expansion of macro 'octeon_has_feature'
     267 |   if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |       ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:389:6: note: in expansion of macro 'OCTEON_IS_MODEL'
     389 |  if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |      ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_initialize':
   drivers/staging/octeon/ethernet-rx.c:489:23: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     489 |   if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:489:7: note: in expansion of macro 'OCTEON_IS_MODEL'
     489 |   if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |       ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_shutdown':
   drivers/staging/octeon/ethernet-rx.c:532:23: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     532 |   if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:532:7: note: in expansion of macro 'OCTEON_IS_MODEL'
     532 |   if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |       ^~~~~~~~~~~~~~~
--
   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet-tx.c:25:
   drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_xmit':
>> drivers/staging/octeon/ethernet-tx.c:227:41: error: 'OCTEON_CN3XXX' undeclared (first use in this function)
     227 |  if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                         ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/ethernet-tx.c:227:41: note: each undeclared identifier is reported only once for each function it appears in
     227 |  if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                         ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-tx.c:227:25: note: in expansion of macro 'OCTEON_IS_MODEL'
     227 |  if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                         ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_xmit_pow':
>> drivers/staging/octeon/ethernet-tx.c:558:23: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     558 |  if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-tx.c:558:7: note: in expansion of macro 'OCTEON_IS_MODEL'
     558 |  if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
         |       ^~~~~~~~~~~~~~~
--
   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet.c:23:
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_common_change_mtu':
>> drivers/staging/octeon/ethernet.c:258:23: error: 'OCTEON_CN3XXX' undeclared (first use in this function)
     258 |   if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/ethernet.c:258:23: note: each undeclared identifier is reported only once for each function it appears in
     258 |   if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:258:7: note: in expansion of macro 'OCTEON_IS_MODEL'
     258 |   if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |       ^~~~~~~~~~~~~~~
>> drivers/staging/octeon/ethernet.c:259:23: error: 'OCTEON_CN58XX' undeclared (first use in this function)
     259 |       OCTEON_IS_MODEL(OCTEON_CN58XX)) {
         |                       ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:259:7: note: in expansion of macro 'OCTEON_IS_MODEL'
     259 |       OCTEON_IS_MODEL(OCTEON_CN58XX)) {
         |       ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_common_open':
>> drivers/staging/octeon/ethernet.c:469:25: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
     469 |  if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                         ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
>> drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet.c:469:6: note: in expansion of macro 'octeon_has_feature'
     469 |  if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |      ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_probe':
>> drivers/staging/octeon/ethernet.c:725:25: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     725 |     if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                         ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:725:9: note: in expansion of macro 'OCTEON_IS_MODEL'
     725 |     if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |         ^~~~~~~~~~~~~~~


vim +12 drivers/staging/octeon/octeon-stubs.h

     7	
     8	#define OCTEON_IRQ_WORKQ0 0
     9	#define OCTEON_IRQ_RML 0
    10	#define OCTEON_IRQ_TIMER1 0
    11	#define OCTEON_IS_MODEL(x) ((void)(x), 0)
  > 12	#define octeon_has_feature(x) ((void)(x), 0)
    13	#define octeon_get_clock_rate()	0
    14	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] staging: octeon: Fix unused macro Argument 'x'
  2025-03-22  0:32 nancyenos
  2025-03-22  6:59 ` kernel test robot
@ 2025-03-23  2:20 ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-23  2:20 UTC (permalink / raw)
  To: nancyenos, outreachy @ lists . linux . dev Greg Kroah-Hartman,
	linux-staging, linux-kernel
  Cc: llvm, oe-kbuild-all, nancyenos

Hi nancyenos,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/nancyenos/staging-octeon-Fix-unused-macro-Argument-x/20250322-084136
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250322003218.14134-1-nicymimz%40gmail.com
patch subject: [PATCH] staging: octeon: Fix unused macro Argument 'x'
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250323/202503231053.WFt2cPIR-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250323/202503231053.WFt2cPIR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503231053.WFt2cPIR-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/octeon/ethernet.c:258:23: error: use of undeclared identifier 'OCTEON_CN3XXX'
     258 |                 if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                                     ^
>> drivers/staging/octeon/ethernet.c:259:23: error: use of undeclared identifier 'OCTEON_CN58XX'
     259 |                     OCTEON_IS_MODEL(OCTEON_CN58XX)) {
         |                                     ^
>> drivers/staging/octeon/ethernet.c:469:25: error: use of undeclared identifier 'OCTEON_FEATURE_PKND'
     469 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                ^
>> drivers/staging/octeon/ethernet.c:725:25: error: use of undeclared identifier 'OCTEON_CN68XX'
     725 |                                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                                                     ^
   4 errors generated.
--
>> drivers/staging/octeon/ethernet-rx.c:67:25: error: use of undeclared identifier 'OCTEON_FEATURE_PKND'
      67 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                ^
>> drivers/staging/octeon/ethernet-rx.c:201:22: error: use of undeclared identifier 'OCTEON_CN68XX'
     201 |         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                             ^
   drivers/staging/octeon/ethernet-rx.c:233:24: error: use of undeclared identifier 'OCTEON_CN68XX'
     233 |                         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                                             ^
   drivers/staging/octeon/ethernet-rx.c:267:26: error: use of undeclared identifier 'OCTEON_FEATURE_PKND'
     267 |                 if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                        ^
   drivers/staging/octeon/ethernet-rx.c:389:22: error: use of undeclared identifier 'OCTEON_CN68XX'
     389 |         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                             ^
   drivers/staging/octeon/ethernet-rx.c:489:23: error: use of undeclared identifier 'OCTEON_CN68XX'
     489 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                                     ^
   drivers/staging/octeon/ethernet-rx.c:532:23: error: use of undeclared identifier 'OCTEON_CN68XX'
     532 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                                     ^
   7 errors generated.
--
>> drivers/staging/octeon/ethernet-tx.c:227:41: error: use of undeclared identifier 'OCTEON_CN3XXX'
     227 |         if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                                ^
>> drivers/staging/octeon/ethernet-tx.c:558:23: error: use of undeclared identifier 'OCTEON_CN68XX'
     558 |         if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                              ^
   2 errors generated.


vim +/OCTEON_CN3XXX +258 drivers/staging/octeon/ethernet.c

422d97b8b05ed3 Chris Packham 2020-02-05  230  
422d97b8b05ed3 Chris Packham 2020-02-05  231  /**
422d97b8b05ed3 Chris Packham 2020-02-05  232   * cvm_oct_common_change_mtu - change the link MTU
422d97b8b05ed3 Chris Packham 2020-02-05  233   * @dev:     Device to change
422d97b8b05ed3 Chris Packham 2020-02-05  234   * @new_mtu: The new MTU
422d97b8b05ed3 Chris Packham 2020-02-05  235   *
422d97b8b05ed3 Chris Packham 2020-02-05  236   * Returns Zero on success
422d97b8b05ed3 Chris Packham 2020-02-05  237   */
422d97b8b05ed3 Chris Packham 2020-02-05  238  static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
422d97b8b05ed3 Chris Packham 2020-02-05  239  {
422d97b8b05ed3 Chris Packham 2020-02-05  240  	struct octeon_ethernet *priv = netdev_priv(dev);
422d97b8b05ed3 Chris Packham 2020-02-05  241  	int interface = INTERFACE(priv->port);
422d97b8b05ed3 Chris Packham 2020-02-05  242  #if IS_ENABLED(CONFIG_VLAN_8021Q)
422d97b8b05ed3 Chris Packham 2020-02-05  243  	int vlan_bytes = VLAN_HLEN;
422d97b8b05ed3 Chris Packham 2020-02-05  244  #else
422d97b8b05ed3 Chris Packham 2020-02-05  245  	int vlan_bytes = 0;
422d97b8b05ed3 Chris Packham 2020-02-05  246  #endif
422d97b8b05ed3 Chris Packham 2020-02-05  247  	int mtu_overhead = ETH_HLEN + ETH_FCS_LEN + vlan_bytes;
422d97b8b05ed3 Chris Packham 2020-02-05  248  
422d97b8b05ed3 Chris Packham 2020-02-05  249  	dev->mtu = new_mtu;
422d97b8b05ed3 Chris Packham 2020-02-05  250  
422d97b8b05ed3 Chris Packham 2020-02-05  251  	if ((interface < 2) &&
422d97b8b05ed3 Chris Packham 2020-02-05  252  	    (cvmx_helper_interface_get_mode(interface) !=
422d97b8b05ed3 Chris Packham 2020-02-05  253  		CVMX_HELPER_INTERFACE_MODE_SPI)) {
422d97b8b05ed3 Chris Packham 2020-02-05  254  		int index = INDEX(priv->port);
422d97b8b05ed3 Chris Packham 2020-02-05  255  		/* Add ethernet header and FCS, and VLAN if configured. */
422d97b8b05ed3 Chris Packham 2020-02-05  256  		int max_packet = new_mtu + mtu_overhead;
422d97b8b05ed3 Chris Packham 2020-02-05  257  
422d97b8b05ed3 Chris Packham 2020-02-05 @258  		if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
422d97b8b05ed3 Chris Packham 2020-02-05 @259  		    OCTEON_IS_MODEL(OCTEON_CN58XX)) {
422d97b8b05ed3 Chris Packham 2020-02-05  260  			/* Signal errors on packets larger than the MTU */
422d97b8b05ed3 Chris Packham 2020-02-05  261  			cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX(index, interface),
422d97b8b05ed3 Chris Packham 2020-02-05  262  				       max_packet);
422d97b8b05ed3 Chris Packham 2020-02-05  263  		} else {
422d97b8b05ed3 Chris Packham 2020-02-05  264  			/*
422d97b8b05ed3 Chris Packham 2020-02-05  265  			 * Set the hardware to truncate packets larger
422d97b8b05ed3 Chris Packham 2020-02-05  266  			 * than the MTU and smaller the 64 bytes.
422d97b8b05ed3 Chris Packham 2020-02-05  267  			 */
422d97b8b05ed3 Chris Packham 2020-02-05  268  			union cvmx_pip_frm_len_chkx frm_len_chk;
422d97b8b05ed3 Chris Packham 2020-02-05  269  
422d97b8b05ed3 Chris Packham 2020-02-05  270  			frm_len_chk.u64 = 0;
422d97b8b05ed3 Chris Packham 2020-02-05  271  			frm_len_chk.s.minlen = VLAN_ETH_ZLEN;
422d97b8b05ed3 Chris Packham 2020-02-05  272  			frm_len_chk.s.maxlen = max_packet;
422d97b8b05ed3 Chris Packham 2020-02-05  273  			cvmx_write_csr(CVMX_PIP_FRM_LEN_CHKX(interface),
422d97b8b05ed3 Chris Packham 2020-02-05  274  				       frm_len_chk.u64);
422d97b8b05ed3 Chris Packham 2020-02-05  275  		}
422d97b8b05ed3 Chris Packham 2020-02-05  276  		/*
422d97b8b05ed3 Chris Packham 2020-02-05  277  		 * Set the hardware to truncate packets larger than
422d97b8b05ed3 Chris Packham 2020-02-05  278  		 * the MTU. The jabber register must be set to a
422d97b8b05ed3 Chris Packham 2020-02-05  279  		 * multiple of 8 bytes, so round up.
422d97b8b05ed3 Chris Packham 2020-02-05  280  		 */
422d97b8b05ed3 Chris Packham 2020-02-05  281  		cvmx_write_csr(CVMX_GMXX_RXX_JABBER(index, interface),
422d97b8b05ed3 Chris Packham 2020-02-05  282  			       (max_packet + 7) & ~7u);
422d97b8b05ed3 Chris Packham 2020-02-05  283  	}
422d97b8b05ed3 Chris Packham 2020-02-05  284  	return 0;
422d97b8b05ed3 Chris Packham 2020-02-05  285  }
422d97b8b05ed3 Chris Packham 2020-02-05  286  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [PATCH] staging: octeon: Fix unused macro Argument 'x'
@ 2025-03-25 10:09 nancyenos
  2025-03-25 11:44 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: nancyenos @ 2025-03-25 10:09 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, outreachy, nancyenos

warning found by checkpath.pl

Signed-off-by: nancyenos <nicymimz@gmail.com>
---
 drivers/staging/octeon/octeon-stubs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index 44cced319c11..0155f3c41657 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -8,8 +8,8 @@
 #define OCTEON_IRQ_WORKQ0 0
 #define OCTEON_IRQ_RML 0
 #define OCTEON_IRQ_TIMER1 0
-#define OCTEON_IS_MODEL(x) 0
-#define octeon_has_feature(x)	0
+#define OCTEON_IS_MODEL(x) ((void)(x), 0)
+#define octeon_has_feature(x) ((void)(x), 0)
 #define octeon_get_clock_rate()	0
 
 #define CVMX_SYNCIOBDMA		do { } while (0)
-- 
2.25.1


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

* Re: [PATCH] staging: octeon: Fix unused macro Argument 'x'
  2025-03-25 10:09 [PATCH] staging: octeon: Fix unused macro Argument 'x' nancyenos
@ 2025-03-25 11:44 ` Julia Lawall
  2025-03-29  2:47 ` kernel test robot
  2025-04-03 14:09 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2025-03-25 11:44 UTC (permalink / raw)
  To: nancyenos; +Cc: gregkh, linux-staging, linux-kernel, outreachy

On Tue, 25 Mar 2025, nancyenos wrote:

> warning found by checkpath.pl
>
> Signed-off-by: nancyenos <nicymimz@gmail.com>
> ---
>  drivers/staging/octeon/octeon-stubs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> index 44cced319c11..0155f3c41657 100644
> --- a/drivers/staging/octeon/octeon-stubs.h
> +++ b/drivers/staging/octeon/octeon-stubs.h
> @@ -8,8 +8,8 @@
>  #define OCTEON_IRQ_WORKQ0 0
>  #define OCTEON_IRQ_RML 0
>  #define OCTEON_IRQ_TIMER1 0
> -#define OCTEON_IS_MODEL(x) 0
> -#define octeon_has_feature(x)	0
> +#define OCTEON_IS_MODEL(x) ((void)(x), 0)
> +#define octeon_has_feature(x) ((void)(x), 0)

I'm not sure that this is useful.  It seems that there may be multiple
definitions; one that has an argument and a default one that doesn't need
anything.  It's true that this change will ensure that x is checked by the
compiler, which may help find some bugs.  Have you seen other code that
makes this kind of change?

thanks,
julia

>  #define octeon_get_clock_rate()	0
>
>  #define CVMX_SYNCIOBDMA		do { } while (0)
> --
> 2.25.1
>
>
>

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

* Re: [PATCH] staging: octeon: Fix unused macro Argument 'x'
  2025-03-25 10:09 [PATCH] staging: octeon: Fix unused macro Argument 'x' nancyenos
  2025-03-25 11:44 ` Julia Lawall
@ 2025-03-29  2:47 ` kernel test robot
  2025-04-03 14:09 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-03-29  2:47 UTC (permalink / raw)
  To: nancyenos, gregkh
  Cc: oe-kbuild-all, linux-staging, linux-kernel, outreachy, nancyenos

Hi nancyenos,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/nancyenos/staging-octeon-Fix-unused-macro-Argument-x/20250325-181353
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250325100952.2956-1-nicymimz%40gmail.com
patch subject: [PATCH] staging: octeon: Fix unused macro Argument 'x'
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20250329/202503291001.v9aaXwZc-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250329/202503291001.v9aaXwZc-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503291001.v9aaXwZc-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet.c:23:
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_common_change_mtu':
>> drivers/staging/octeon/ethernet.c:258:37: error: 'OCTEON_CN3XXX' undeclared (first use in this function)
     258 |                 if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/ethernet.c:258:37: note: each undeclared identifier is reported only once for each function it appears in
     258 |                 if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:258:21: note: in expansion of macro 'OCTEON_IS_MODEL'
     258 |                 if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
         |                     ^~~~~~~~~~~~~~~
>> drivers/staging/octeon/ethernet.c:259:37: error: 'OCTEON_CN58XX' undeclared (first use in this function)
     259 |                     OCTEON_IS_MODEL(OCTEON_CN58XX)) {
         |                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:259:21: note: in expansion of macro 'OCTEON_IS_MODEL'
     259 |                     OCTEON_IS_MODEL(OCTEON_CN58XX)) {
         |                     ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_common_open':
>> drivers/staging/octeon/ethernet.c:469:32: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
     469 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
   drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet.c:469:13: note: in expansion of macro 'octeon_has_feature'
     469 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |             ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet.c: In function 'cvm_oct_probe':
>> drivers/staging/octeon/ethernet.c:725:53: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     725 |                                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet.c:725:37: note: in expansion of macro 'OCTEON_IS_MODEL'
     725 |                                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                                     ^~~~~~~~~~~~~~~
--
   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet-rx.c:26:
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_check_rcv_error':
>> drivers/staging/octeon/ethernet-rx.c:67:32: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
      67 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
   drivers/staging/octeon/ethernet-rx.c:67:32: note: each undeclared identifier is reported only once for each function it appears in
      67 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
   drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet-rx.c:67:13: note: in expansion of macro 'octeon_has_feature'
      67 |         if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |             ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_poll':
>> drivers/staging/octeon/ethernet-rx.c:201:29: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     201 |         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                             ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:201:13: note: in expansion of macro 'OCTEON_IS_MODEL'
     201 |         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |             ^~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:233:29: note: in expansion of macro 'OCTEON_IS_MODEL'
     233 |                         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                             ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c:267:40: error: 'OCTEON_FEATURE_PKND' undeclared (first use in this function)
     267 |                 if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                                        ^~~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:12:39: note: in definition of macro 'octeon_has_feature'
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                       ^
   drivers/staging/octeon/octeon-stubs.h:12:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      12 | #define octeon_has_feature(x) ((void)(x), 0)
         |                                         ^
   drivers/staging/octeon/ethernet-rx.c:267:21: note: in expansion of macro 'octeon_has_feature'
     267 |                 if (octeon_has_feature(OCTEON_FEATURE_PKND))
         |                     ^~~~~~~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:389:13: note: in expansion of macro 'OCTEON_IS_MODEL'
     389 |         if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |             ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_initialize':
   drivers/staging/octeon/ethernet-rx.c:489:37: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     489 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:489:21: note: in expansion of macro 'OCTEON_IS_MODEL'
     489 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
         |                     ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_shutdown':
   drivers/staging/octeon/ethernet-rx.c:532:37: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     532 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                                     ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-rx.c:532:21: note: in expansion of macro 'OCTEON_IS_MODEL'
     532 |                 if (OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                     ^~~~~~~~~~~~~~~
--
   In file included from drivers/staging/octeon/octeon-ethernet.h:41,
                    from drivers/staging/octeon/ethernet-tx.c:25:
   drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_xmit':
>> drivers/staging/octeon/ethernet-tx.c:227:48: error: 'OCTEON_CN3XXX' undeclared (first use in this function)
     227 |         if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                                ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/ethernet-tx.c:227:48: note: each undeclared identifier is reported only once for each function it appears in
     227 |         if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                                ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-tx.c:227:32: note: in expansion of macro 'OCTEON_IS_MODEL'
     227 |         if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
         |                                ^~~~~~~~~~~~~~~
   drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_xmit_pow':
>> drivers/staging/octeon/ethernet-tx.c:558:30: error: 'OCTEON_CN68XX' undeclared (first use in this function)
     558 |         if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
         |                              ^~~~~~~~~~~~~
   drivers/staging/octeon/octeon-stubs.h:11:36: note: in definition of macro 'OCTEON_IS_MODEL'
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                    ^
   drivers/staging/octeon/octeon-stubs.h:11:38: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      11 | #define OCTEON_IS_MODEL(x) ((void)(x), 0)
         |                                      ^
   drivers/staging/octeon/ethernet-tx.c:558:14: note: in expansion of macro 'OCTEON_IS_MODEL'
     558 |         if (!OCTEON_IS_MODEL(OCTEON_CN68XX))
         |              ^~~~~~~~~~~~~~~


vim +/OCTEON_CN3XXX +258 drivers/staging/octeon/ethernet.c

422d97b8b05ed38 Chris Packham 2020-02-05  230  
422d97b8b05ed38 Chris Packham 2020-02-05  231  /**
422d97b8b05ed38 Chris Packham 2020-02-05  232   * cvm_oct_common_change_mtu - change the link MTU
422d97b8b05ed38 Chris Packham 2020-02-05  233   * @dev:     Device to change
422d97b8b05ed38 Chris Packham 2020-02-05  234   * @new_mtu: The new MTU
422d97b8b05ed38 Chris Packham 2020-02-05  235   *
422d97b8b05ed38 Chris Packham 2020-02-05  236   * Returns Zero on success
422d97b8b05ed38 Chris Packham 2020-02-05  237   */
422d97b8b05ed38 Chris Packham 2020-02-05  238  static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
422d97b8b05ed38 Chris Packham 2020-02-05  239  {
422d97b8b05ed38 Chris Packham 2020-02-05  240  	struct octeon_ethernet *priv = netdev_priv(dev);
422d97b8b05ed38 Chris Packham 2020-02-05  241  	int interface = INTERFACE(priv->port);
422d97b8b05ed38 Chris Packham 2020-02-05  242  #if IS_ENABLED(CONFIG_VLAN_8021Q)
422d97b8b05ed38 Chris Packham 2020-02-05  243  	int vlan_bytes = VLAN_HLEN;
422d97b8b05ed38 Chris Packham 2020-02-05  244  #else
422d97b8b05ed38 Chris Packham 2020-02-05  245  	int vlan_bytes = 0;
422d97b8b05ed38 Chris Packham 2020-02-05  246  #endif
422d97b8b05ed38 Chris Packham 2020-02-05  247  	int mtu_overhead = ETH_HLEN + ETH_FCS_LEN + vlan_bytes;
422d97b8b05ed38 Chris Packham 2020-02-05  248  
422d97b8b05ed38 Chris Packham 2020-02-05  249  	dev->mtu = new_mtu;
422d97b8b05ed38 Chris Packham 2020-02-05  250  
422d97b8b05ed38 Chris Packham 2020-02-05  251  	if ((interface < 2) &&
422d97b8b05ed38 Chris Packham 2020-02-05  252  	    (cvmx_helper_interface_get_mode(interface) !=
422d97b8b05ed38 Chris Packham 2020-02-05  253  		CVMX_HELPER_INTERFACE_MODE_SPI)) {
422d97b8b05ed38 Chris Packham 2020-02-05  254  		int index = INDEX(priv->port);
422d97b8b05ed38 Chris Packham 2020-02-05  255  		/* Add ethernet header and FCS, and VLAN if configured. */
422d97b8b05ed38 Chris Packham 2020-02-05  256  		int max_packet = new_mtu + mtu_overhead;
422d97b8b05ed38 Chris Packham 2020-02-05  257  
422d97b8b05ed38 Chris Packham 2020-02-05 @258  		if (OCTEON_IS_MODEL(OCTEON_CN3XXX) ||
422d97b8b05ed38 Chris Packham 2020-02-05 @259  		    OCTEON_IS_MODEL(OCTEON_CN58XX)) {
422d97b8b05ed38 Chris Packham 2020-02-05  260  			/* Signal errors on packets larger than the MTU */
422d97b8b05ed38 Chris Packham 2020-02-05  261  			cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX(index, interface),
422d97b8b05ed38 Chris Packham 2020-02-05  262  				       max_packet);
422d97b8b05ed38 Chris Packham 2020-02-05  263  		} else {
422d97b8b05ed38 Chris Packham 2020-02-05  264  			/*
422d97b8b05ed38 Chris Packham 2020-02-05  265  			 * Set the hardware to truncate packets larger
422d97b8b05ed38 Chris Packham 2020-02-05  266  			 * than the MTU and smaller the 64 bytes.
422d97b8b05ed38 Chris Packham 2020-02-05  267  			 */
422d97b8b05ed38 Chris Packham 2020-02-05  268  			union cvmx_pip_frm_len_chkx frm_len_chk;
422d97b8b05ed38 Chris Packham 2020-02-05  269  
422d97b8b05ed38 Chris Packham 2020-02-05  270  			frm_len_chk.u64 = 0;
422d97b8b05ed38 Chris Packham 2020-02-05  271  			frm_len_chk.s.minlen = VLAN_ETH_ZLEN;
422d97b8b05ed38 Chris Packham 2020-02-05  272  			frm_len_chk.s.maxlen = max_packet;
422d97b8b05ed38 Chris Packham 2020-02-05  273  			cvmx_write_csr(CVMX_PIP_FRM_LEN_CHKX(interface),
422d97b8b05ed38 Chris Packham 2020-02-05  274  				       frm_len_chk.u64);
422d97b8b05ed38 Chris Packham 2020-02-05  275  		}
422d97b8b05ed38 Chris Packham 2020-02-05  276  		/*
422d97b8b05ed38 Chris Packham 2020-02-05  277  		 * Set the hardware to truncate packets larger than
422d97b8b05ed38 Chris Packham 2020-02-05  278  		 * the MTU. The jabber register must be set to a
422d97b8b05ed38 Chris Packham 2020-02-05  279  		 * multiple of 8 bytes, so round up.
422d97b8b05ed38 Chris Packham 2020-02-05  280  		 */
422d97b8b05ed38 Chris Packham 2020-02-05  281  		cvmx_write_csr(CVMX_GMXX_RXX_JABBER(index, interface),
422d97b8b05ed38 Chris Packham 2020-02-05  282  			       (max_packet + 7) & ~7u);
422d97b8b05ed38 Chris Packham 2020-02-05  283  	}
422d97b8b05ed38 Chris Packham 2020-02-05  284  	return 0;
422d97b8b05ed38 Chris Packham 2020-02-05  285  }
422d97b8b05ed38 Chris Packham 2020-02-05  286  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] staging: octeon: Fix unused macro Argument 'x'
  2025-03-25 10:09 [PATCH] staging: octeon: Fix unused macro Argument 'x' nancyenos
  2025-03-25 11:44 ` Julia Lawall
  2025-03-29  2:47 ` kernel test robot
@ 2025-04-03 14:09 ` Greg KH
  2 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2025-04-03 14:09 UTC (permalink / raw)
  To: nancyenos; +Cc: linux-staging, linux-kernel, outreachy

On Tue, Mar 25, 2025 at 03:09:52AM -0700, nancyenos wrote:
> warning found by checkpath.pl
> 
> Signed-off-by: nancyenos <nicymimz@gmail.com>
> ---
>  drivers/staging/octeon/octeon-stubs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> index 44cced319c11..0155f3c41657 100644
> --- a/drivers/staging/octeon/octeon-stubs.h
> +++ b/drivers/staging/octeon/octeon-stubs.h
> @@ -8,8 +8,8 @@
>  #define OCTEON_IRQ_WORKQ0 0
>  #define OCTEON_IRQ_RML 0
>  #define OCTEON_IRQ_TIMER1 0
> -#define OCTEON_IS_MODEL(x) 0
> -#define octeon_has_feature(x)	0
> +#define OCTEON_IS_MODEL(x) ((void)(x), 0)
> +#define octeon_has_feature(x) ((void)(x), 0)
>  #define octeon_get_clock_rate()	0
>  
>  #define CVMX_SYNCIOBDMA		do { } while (0)
> -- 
> 2.25.1
> 
> 

You sent this twice?

And always test-build your patches before submitting them.  This
obviously will not build :(

thanks,

greg k-h

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

end of thread, other threads:[~2025-04-03 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-25 10:09 [PATCH] staging: octeon: Fix unused macro Argument 'x' nancyenos
2025-03-25 11:44 ` Julia Lawall
2025-03-29  2:47 ` kernel test robot
2025-04-03 14:09 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2025-03-22  0:32 nancyenos
2025-03-22  6:59 ` kernel test robot
2025-03-23  2:20 ` kernel test robot

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).