mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [net-next PATCH] octeontx2-af: fix array bound error
@ 2022-02-10 16:35 Hariprasad Kelam
  2022-02-10 18:39 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Hariprasad Kelam @ 2022-02-10 16:35 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, lcherian, gakula, jerinj, sbhatta, hkelam

This patch fixes below error by using proper data type.

drivers/net/ethernet/marvell/octeontx2/af/rpm.c: In function
'rpm_cfg_pfc_quanta_thresh':
include/linux/find.h:40:23: error: array subscript 'long unsigned
int[0]' is partly outside array bounds of 'u16[1]' {aka 'short unsigned
int[1]'} [-Werror=array-bounds]
   40 |                 val = *addr & GENMASK(size - 1, offset);

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
index d7a8aad46e12..47e83d7a5804 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
@@ -141,14 +141,15 @@ int rpm_lmac_get_pause_frm_status(void *rpmd, int lmac_id,
 	return 0;
 }
 
-static void rpm_cfg_pfc_quanta_thresh(rpm_t *rpm, int lmac_id, u16 pfc_en,
+static void rpm_cfg_pfc_quanta_thresh(rpm_t *rpm, int lmac_id,
+				      unsigned long pfc_en,
 				      bool enable)
 {
 	u64 quanta_offset = 0, quanta_thresh = 0, cfg;
 	int i, shift;
 
 	/* Set pause time and interval */
-	for_each_set_bit(i, (unsigned long *)&pfc_en, 16) {
+	for_each_set_bit(i, &pfc_en, 16) {
 		switch (i) {
 		case 0:
 		case 1:
-- 
2.17.1


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

* Re: [net-next PATCH] octeontx2-af: fix array bound error
  2022-02-10 16:35 [net-next PATCH] octeontx2-af: fix array bound error Hariprasad Kelam
@ 2022-02-10 18:39 ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2022-02-10 18:39 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: netdev, linux-kernel, davem, sgoutham, lcherian, gakula, jerinj, sbhatta

On Thu, 10 Feb 2022 22:05:57 +0530 Hariprasad Kelam wrote:
> This patch fixes below error by using proper data type.
> 
> drivers/net/ethernet/marvell/octeontx2/af/rpm.c: In function
> 'rpm_cfg_pfc_quanta_thresh':
> include/linux/find.h:40:23: error: array subscript 'long unsigned
> int[0]' is partly outside array bounds of 'u16[1]' {aka 'short unsigned
> int[1]'} [-Werror=array-bounds]
>    40 |                 val = *addr & GENMASK(size - 1, offset);
> 
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>

Could you send the Reported-by: tag? Was it repored by the kernel
build bot? 

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

* Re: [net-next PATCH] octeontx2-af: fix array bound error
@ 2022-02-11 15:54 Hariprasad Kelam
  0 siblings, 0 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2022-02-11 15:54 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, linux-kernel, davem, Sunil Kovvuri Goutham, Linu Cherian,
	Geethasowjanya Akula, Jerin Jacob Kollanukkaran,
	Subbaraya Sundeep Bhatta



On Thu, 10 Feb 2022 22:05:57 +0530 Hariprasad Kelam wrote:
> This patch fixes below error by using proper data type.
> 
> drivers/net/ethernet/marvell/octeontx2/af/rpm.c: In function
> 'rpm_cfg_pfc_quanta_thresh':
> include/linux/find.h:40:23: error: array subscript 'long unsigned 
> int[0]' is partly outside array bounds of 'u16[1]' {aka 'short 
> unsigned int[1]'} [-Werror=array-bounds]
>    40 |                 val = *addr & GENMASK(size - 1, offset);
> 
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>

Could you send the Reported-by: tag? Was it repored by the kernel build bot? 

No its reported by Stephen Rothwell <sfr@canb.auug.org.au> 
I have added Reported-by tag in V2

Thanks,
Hariprasad k

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

end of thread, other threads:[~2022-02-11 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 16:35 [net-next PATCH] octeontx2-af: fix array bound error Hariprasad Kelam
2022-02-10 18:39 ` Jakub Kicinski
2022-02-11 15:54 Hariprasad Kelam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®