From: Ivan Vecera <ivecera@redhat.com>
To: Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, arkadis@mellanox.com,
idosch@mellanox.com, mlxsw@mellanox.com, jhs@mojatatu.com,
roopa@cumulusnetworks.com, f.fainelli@gmail.com,
vivien.didelot@savoirfairelinux.com, john.fastabend@gmail.com,
andrew@lunn.ch, simon.horman@netronome.com
Subject: Re: [patch net-next 0/8] Add support for pipeline debug (dpipe)
Date: Tue, 28 Mar 2017 09:42:58 +0200 [thread overview]
Message-ID: <251a02fa-4c4a-bd69-1411-74a0c79726a2@redhat.com> (raw)
In-Reply-To: <20170328071051.GB1873@nanopsycho.orion>
Dne 28.3.2017 v 09:10 Jiri Pirko napsal(a):
> Tue, Mar 28, 2017 at 12:48:34AM CEST, davem@davemloft.net wrote:
>>
>> Please fix up these warnings and resubmit:
>>
>> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function ‘mlxsw_sp_rif_counter_free’:
>> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:208:2: warning: ‘p_counter_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>> mlxsw_sp_rif_counter_edit(mlxsw_sp, rif->rif_index,
>> ^
>
> This is I believe also gcc bug. Code looks fine. I'm not getting the warning
> with gcc 6
>
No it is not a gcc bug. The function mlxsw_sp_rif_counter_free() is not static
so the compiler cannot know all its callers and so 'dir' parameter can be
theoretically anything.
You call mlxsw_sp_rif_p_counter_get() there it assumes dir can be only
MLXSW_SP_RIF_COUNTER_EGRESS or MLXSW_SP_RIF_COUNTER_INGRESS so initializes
*pp_counter_index only for them. For any other value the value is uninitialized.
Ivan
next prev parent reply other threads:[~2017-03-28 7:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 7:35 [patch net-next 0/8] Add support for pipeline debug (dpipe) Jiri Pirko
2017-03-25 7:35 ` [patch net-next 1/8] devlink: Support " Jiri Pirko
2017-03-25 7:35 ` [patch net-next 2/8] mlxsw: reg: Add counter fields to RITR register Jiri Pirko
2017-03-25 7:35 ` [patch net-next 3/8] mlxsw: spectrum: Add placeholder for dpipe Jiri Pirko
2017-03-25 7:35 ` [patch net-next 4/8] mlxsw: spectrum: Add definition for egress rif table Jiri Pirko
2017-03-25 7:35 ` [patch net-next 5/8] mlxsw: reg: Add Router Interface Counter Register Jiri Pirko
2017-03-25 7:35 ` [patch net-next 6/8] mlxsw: spectrum: Support for counters on router interfaces Jiri Pirko
2017-03-25 7:35 ` [patch net-next 7/8] mlxsw: spectrum_router: Add rif helper functions Jiri Pirko
2017-03-25 7:35 ` [patch net-next 8/8] mlxsw: spectrum: Add Support for erif table entries access Jiri Pirko
2017-03-25 7:37 ` [patch iproute2/net-next] devlink: Add support for pipeline debug (dpipe) Jiri Pirko
2017-03-27 22:48 ` [patch net-next 0/8] " David Miller
2017-03-28 6:51 ` Jiri Pirko
2017-03-28 7:58 ` Ivan Vecera
2017-03-28 8:05 ` Jiri Pirko
2017-03-28 18:00 ` David Miller
2017-03-28 7:10 ` Jiri Pirko
2017-03-28 7:42 ` Ivan Vecera [this message]
2017-03-28 7:57 ` Jiri Pirko
2017-03-28 7:59 ` Jiri Pirko
2017-03-28 8:10 ` Ivan Vecera
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=251a02fa-4c4a-bd69-1411-74a0c79726a2@redhat.com \
--to=ivecera@redhat.com \
--cc=andrew@lunn.ch \
--cc=arkadis@mellanox.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=simon.horman@netronome.com \
--cc=vivien.didelot@savoirfairelinux.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).