Message ID | 169807094481.1031379.3782128425635686671.stgit@ebuild |
---|---|
State | Accepted |
Delegated to: | Simon Horman |
Headers | show |
Series | Fix some of Clang's static analyzer warnings. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
On Mon, Oct 23, 2023 at 04:22:24PM +0200, Eelco Chaudron wrote: > This patch addresses a 'Dead assignment' warning by designating > the variable as OVS_UNUSED. We opted for this approach instead > of comparing it to the sizeof(struct ...) method because of > concerns related to code clarity. > > Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Thanks, I confirmed that this addresses warnings generated by clang-tidy. And I agree this is a reasonable approach. Acked-by: Simon Horman <horms@ovn.org>
diff --git a/lib/ofp-monitor.c b/lib/ofp-monitor.c index c27733a52..29b0c5965 100644 --- a/lib/ofp-monitor.c +++ b/lib/ofp-monitor.c @@ -962,7 +962,7 @@ ofputil_decode_flow_update(struct ofputil_flow_update *update, return 0; } else if (update->event == OFPFME_PAUSED || update->event == OFPFME_RESUMED) { - struct ofp_flow_update_paused *ofup; + struct ofp_flow_update_paused *ofup OVS_UNUSED; if (length != sizeof *ofup) { goto bad_len;
This patch addresses a 'Dead assignment' warning by designating the variable as OVS_UNUSED. We opted for this approach instead of comparing it to the sizeof(struct ...) method because of concerns related to code clarity. Signed-off-by: Eelco Chaudron <echaudro@redhat.com> --- lib/ofp-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)