[PATCH v3 00/14] Remove unnecessary function pointer deref
Stephen Hemminger
stephen at networkplumber.org
Mon Mar 10 23:26:27 CET 2025
On Wed, 5 Mar 2025 17:52:50 +0100
David Marchand <david.marchand at redhat.com> wrote:
> On Thu, Feb 20, 2025 at 5:57 PM Stephen Hemminger
> <stephen at networkplumber.org> wrote:
> >
> > A common pattern in DPDK internals is to have an array of function
> > pointers. When using these pointers an unnecessary derefence is done;
> > this is allowed in C because of a historical quirk but unnecessary.
> >
> > This fixes all instances of PVS Studio checker warning:
> > https://pvs-studio.com/en/docs/warnings/v516/
> >
> > This leads to a large number of warnings marked as High severity.
> > This patchset simplifies the source and gets rid of these warnings.
> >
> > v3 - remove unnecessary paren in ethdev ip_reassembly capability
> >
> > Stephen Hemminger (14):
> > ethdev: remove unnecessary deref on function pointers
> > eventdev: remover unnecessary deref on function pointers
> > net/bonding: remove unnecessary deref of function pointers
> > net/ixgbe: remove unnecessary dereference
> > net/ipn3ke: remove unnecessary dereference
> > net/memif: remove unnecessary deref of function pointers
> > cryptodev: remove unnecessary deref of function pointers
> > crypto/scheduler: remove unnecessary dereference
> > compressdev: remove unnecessary deref of function pointers
> > dmadev: remove unnecessary deref of function pointers
> > rawdev: remove unnecessary deref of function pointers
> > mldev: remove unnecessary deref of function pointers
> > regexdev: remove unnecessary deref of function pointers
> > security: remove unnecessary dereference
>
> I fixed a few missed occurences in touched libraries.
> Series applied, thanks.
>
>
> I noticed there are some occurences in lib/jobstats, lib/port and lib/vhost.
> Would it be possible to have a coccinelle script for this?
It would be hard because coccinelle infers types, and each function pointer
has a different signature.
More information about the dev
mailing list