netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Lai <justinlai0215@realtek.com>
To: Simon Horman <horms@kernel.org>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Larry Chiu <larry.chiu@realtek.com>,
	kernel test robot <lkp@intel.com>
Subject: RE: [PATCH net v3 1/3] rtase: Modify the condition used to detect overflow in rtase_calc_time_mitigation
Date: Wed, 23 Apr 2025 11:32:01 +0000	[thread overview]
Message-ID: <59893ad874224d209b1b43c00c56ba00@realtek.com> (raw)
In-Reply-To: <20250422132023.GG2843373@horms.kernel.org>

> On Thu, Apr 17, 2025 at 04:56:57PM +0800, Justin Lai wrote:
> > Fix the following compile error reported by the kernel test robot by
> > modifying the condition used to detect overflow in
> > rtase_calc_time_mitigation.
> >
> > In file included from include/linux/mdio.h:10:0,
> >                   from
> drivers/net/ethernet/realtek/rtase/rtase_main.c:58:
> >  In function 'u16_encode_bits',
> >      inlined from 'rtase_calc_time_mitigation.constprop' at drivers/net/
> >      ethernet/realtek/rtase/rtase_main.c:1915:13,
> >      inlined from 'rtase_init_software_variable.isra.41' at drivers/net/
> >      ethernet/realtek/rtase/rtase_main.c:1961:13,
> >      inlined from 'rtase_init_one' at drivers/net/ethernet/realtek/
> >      rtase/rtase_main.c:2111:2:
> > >> include/linux/bitfield.h:178:3: error: call to '__field_overflow'
> >       declared with attribute error: value doesn't fit into mask
> >     __field_overflow();     \
> >     ^~~~~~~~~~~~~~~~~~
> >  include/linux/bitfield.h:198:2: note: in expansion of macro
> > '____MAKE_OP'
> >    ____MAKE_OP(u##size,u##size,,)
> >    ^~~~~~~~~~~
> >  include/linux/bitfield.h:200:1: note: in expansion of macro
> > '__MAKE_OP'
> >   __MAKE_OP(16)
> >   ^~~~~~~~~
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202503182158.nkAlbJWX-lkp@intel.
> > com/
> > Fixes: a36e9f5cfe9e ("rtase: Add support for a pci table in this
> > module")
> > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> 
> Hi Justin,
> 
> FWIIW, I note that this problem is reported by GCC 7.5.0 on sparc64 but not by
> GCC 14.2.0. And I think that is because in the end the values passed to
> u16_encode_bits (line 1915 in the trace above) are the same with and without
> this patch. That is to say, this the compiler error above is a false positive of
> sorts.
> 
> But I believe GCC 7.5.0 is a supported compiler version for sparc64.
> And this does result in an error, without W=1 or any other extra KCFLAGS set.
> So I agree this is appropriate to treat as a fix for net.
> 
> And in any case, fix or no fix, it seems nice to limit the scope of the
> initialisation of msb.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

Hi Simon,

Thank you for your review. I will repost this patch separately in the
net tree.

Thanks,
Justin


  reply	other threads:[~2025-04-23 11:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  8:56 [PATCH net v3 0/3] Modify overflow detection, expand ivec->name, and correct type in min_t Justin Lai
2025-04-17  8:56 ` [PATCH net v3 1/3] rtase: Modify the condition used to detect overflow in rtase_calc_time_mitigation Justin Lai
2025-04-22 13:20   ` Simon Horman
2025-04-23 11:32     ` Justin Lai [this message]
2025-04-17  8:56 ` [PATCH net v3 2/3] rtase: Increase the size of ivec->name Justin Lai
2025-04-22 12:55   ` Simon Horman
2025-04-23 11:53     ` Justin Lai
2025-04-23 16:16       ` Simon Horman
2025-04-17  8:56 ` [PATCH net v3 3/3] rtase: Fix a type error in min_t Justin Lai
2025-04-22 13:28   ` Simon Horman
2025-04-23 10:53     ` Justin Lai
2025-04-23 16:16       ` Simon Horman
2025-04-27  9:57     ` David Laight
2025-04-29  8:46       ` Justin Lai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59893ad874224d209b1b43c00c56ba00@realtek.com \
    --to=justinlai0215@realtek.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=larry.chiu@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkshih@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).