Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106239/?format=api
https://patches.dpdk.org/api/patches/106239/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220124000518.319850-1-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220124000518.319850-1-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20220124000518.319850-1-stephen@networkplumber.org", "date": "2022-01-24T00:03:56", "name": "[00/82] remove unnecessary null checks", "commit_ref": null, "pull_url": null, "state": null, "archived": false, "hash": null, "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220124000518.319850-1-stephen@networkplumber.org/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/106239/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/106239/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 49DE4A04A6;\n\tMon, 24 Jan 2022 01:05:25 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BABC74068B;\n\tMon, 24 Jan 2022 01:05:24 +0100 (CET)", "from mail-pg1-f169.google.com (mail-pg1-f169.google.com\n [209.85.215.169])\n by mails.dpdk.org (Postfix) with ESMTP id A601840040\n for <dev@dpdk.org>; Mon, 24 Jan 2022 01:05:22 +0100 (CET)", "by mail-pg1-f169.google.com with SMTP id i8so13592667pgt.13\n for <dev@dpdk.org>; Sun, 23 Jan 2022 16:05:22 -0800 (PST)", "from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199])\n by smtp.gmail.com with ESMTPSA id\n ck21sm10935350pjb.51.2022.01.23.16.05.20\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 23 Jan 2022 16:05:20 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\n h=from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=BTOSIdbYIBQPuUlGWzWzZaqzzYhMMpdXC5+1GzV9/tw=;\n b=GqBZdJZkoQYI7+c+oPOAmLloBoa0fnlbrK/wSjXj6R8LRehg5Rd92Y4H/YAcgWMett\n Nqju0xsiHoS8sJBKC81r/bURTKRM38s579fS5uX1J/LxqE/3IN/jT6HplsylJRFS5Am2\n z3UTxsk14E2NRsUF+hZu0IHpcl0yQDlCf3FVHt8KKWxVSbXo2GN9T17UhQgA1CjYm+O9\n n6ZfGZfNnL5302h7KX3pYSlIFsKsqmbri20aQyi4MfCCEZY56Cg0c/4ynaqIYjcx93mY\n fWclbaDqQllcYxLqV35BT+5VwZZ/2bWY2lY5bPPa0Y3ZNNByswXCZo1zwINgpQ4tZYqr\n 4GVw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=BTOSIdbYIBQPuUlGWzWzZaqzzYhMMpdXC5+1GzV9/tw=;\n b=kPBgbJznHabRadV+A5aU/uTyhVuNG0fqBVnqXAparDyyQohHj+MenUWmnApo8oX/S9\n Y2bp09Tty0ZMj2xiUIndKRbnIRuuTX4oDpO3Pv0V0w3CjrLttEb4twVtIt8+uBCzZmoW\n PUzJ/gXRYY6nU9Ne+sah3idRDpitV8Gt6ibc9byFov+SsEF+UzFIHhfRV3vWWXbCjN0J\n JsVCmeHmG753kXOPK4R2J0AMk3UcV1Ff2nn2VOsR1S6MBgXR19N95J/MH9a+gzL3H4l9\n R0y5n2/MG2gpXOlaj08upshnZg/aImLp31cXn0w+BS+n0W3FVoJw8VASgcSu3WIT2eZU\n GyZw==", "X-Gm-Message-State": "AOAM533Z2faOfWF7nf7jH1mkQzqtFO8mFz/g4eaH2znozeaKdkHenbge\n EAbtC7LNocf0HqA0IrIA19X8lyqhrz0+Ew==", "X-Google-Smtp-Source": "\n ABdhPJwy/PfYp3j71qMmWFlvEDFj14VAs8WGQceinJlFX/23A2+IlU1NU8Vt8KRnZP4nZFEO1hUX9w==", "X-Received": "by 2002:a05:6a00:1896:b0:4c9:6027:e847 with SMTP id\n x22-20020a056a00189600b004c96027e847mr2083089pfh.15.1642982721407;\n Sun, 23 Jan 2022 16:05:21 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Subject": "[PATCH 00/82] remove unnecessary null checks", "Date": "Sun, 23 Jan 2022 16:03:56 -0800", "Message-Id": "<20220124000518.319850-1-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.30.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "While working on a new driver, noticed that some drivers always call\nfree routines (correct) and others conditionally call free routines\nif not null (redundant check). The extra if(e != NULL) type check\nis unneeded and adds extra code. Better to have all the code\nconsistent.\n\nThe Linux kernel has automated this kind of fixup using coccinelle,\nand this patchset creates a coccinelle script to do the transformation;\nthen has individual patches for each sub component.\n\nIn one driver dpaaxx, the change suggested a further change\nto the compat macros to make them even simpler.\n\nStephen Hemminger (82):\n devtools/cocci: add script to fix unnecessary null checks\n eal: remove unnecessary NULL checks\n eal/windows: remove unnecessary NULL checks before free\n examples/fips_validation: remove unnecessary NULL checks\n examples/ip_pipeline: remove unnecessary NULL checks\n examples/pipeline/thread: remove unnecessary NULL checks\n examples/l2fwd-cat: remove unnecessary NULL checks\n lib/vhost: remove unnecessary NULL checks\n examples/vhost_blk: remove unnecessary NULL checks\n app/pdump: remove unnecessary NULL checks\n app/test-crypto-perf: remove unnecessary NULL checks\n app/test-pmd: remove unnecessary NULL checks\n app/test-regex: remove unnecessary NULL checks\n app/test: remove unnecessary NULL checks\n baseband/acc100 remove unnecessary NULL checks\n baseband/la12xx remove unnecessary NULL checks\n baseband/null remove unnecessary NULL checks\n baseband/turbo_sw remove unnecessary NULL checks\n bus/fslmc: remove unnecessary NULL checks\n bus/ifpga: remove unnecessary NULL checks\n bus/pci: remove unnecessary NULL checks\n common/cpt: remove unnecessary NULL checks\n common/dpaax: simplify kernel compat macros\n common/mlx5: remove unnecessary NULL checks\n common/qat: remove unnecessary NULL checks\n compress/mlx5: remove unnecessary NULL checks\n compress/octeontx: remove unnecessary NULL checks\n crypto/armv8: remove unnecessary NULL checks\n crypto/ccp: remove unnecessary NULL checks\n crypto/cnxk: remove unnecessary NULL checks\n crypto/ipsec_mb: remove unnecessary NULL checks\n crypto/mvsam: remove unnecessary NULL checks\n crypto/null: remove unnecessary NULL checks\n crypto/octeontx: remove unnecessary NULL checks\n crypto/openssl: remove unnecessary NULL checks\n crypto/scheduler: remove unnecessary NULL checks\n crypto/virtio: remove unnecessary NULL checks\n event/sw: remove unnecessary NULL checks\n net/axgbe: remove unnecessary NULL checks\n net/bnx2x: remove unnecessary NULL checks\n net/bnxt: remove unnecessary NULL checks\n net/bonding: remove unnecessary NULL checks\n net/cnxk: remove unnecessary NULL checks\n net/cxgbe: remove unnecessary NULL checks\n net/dpaa: remove unnecessary NULL checks\n net/dpaa2: remove unnecessary NULL checks\n net/ena: remove unnecessary NULL checks\n net/hinic: remove unnecessary NULL checks\n net/hns3: remove unnecessary NULL checks\n net/i40e: remove unnecessary NULL checks\n net/iavf: remove unnecessary NULL checks\n net/ice: remove unnecessary NULL checks\n net/igc: remove unnecessary NULL checks\n net/ixgbe: remove unnecessary NULL checks\n net/memif: remove unnecessary NULL checks\n net/mlx4: remove unnecessary NULL checks\n net/mlx5: remove unnecessary NULL checks\n net/mvpp2: remove unnecessary NULL checks\n net/netvsc: remove unnecessary NULL checks\n net/null: remove unnecessary NULL checks\n net/octeontx: remove unnecessary NULL checks\n net/qede: remove unnecessary NULL checks\n net/softnic: remove unnecessary NULL checks\n net/tap: remove unnecessary NULL checks\n net/txgbe: remove unnecessary NULL checks\n net/vdev_netvsc: remove unnecessary NULL checks\n net/virtio: remove unnecessary NULL checks\n raw/cnxk_bphy: remove unnecessary NULL checks\n raw/dpaa2_qdma: remove unnecessary NULL checks\n raw/ifpga: remove unnecessary NULL checks\n raw/skeleton: remove unnecessary NULL checks\n regex/cn9k: remove unnecessary NULL checks\n regex/mlx5: remove unnecessary NULL checks\n vdpa/ifc: remove unnecessary NULL checks\n vdpa/mlx5: remove unnecessary NULL checks\n compressdev: remove unnecessary NULL checks\n ethdev: remove unnecessary NULL checks\n graph: remove unnecessary NULL checks\n ipsec: remove unnecessary NULL checks\n port: remove unnecessary NULL checks\n power: remove unnecessary NULL checks\n reorder: remove unnecessary NULL checks\n\n app/pdump/main.c | 9 ++--\n app/test-crypto-perf/cperf_test_latency.c | 3 +-\n .../cperf_test_pmd_cyclecount.c | 9 ++--\n app/test-crypto-perf/cperf_test_throughput.c | 3 +-\n .../cperf_test_vector_parsing.c | 6 +--\n app/test-crypto-perf/cperf_test_verify.c | 3 +-\n app/test-pmd/cmd_flex_item.c | 3 +-\n app/test-pmd/cmdline.c | 3 +-\n app/test-pmd/testpmd.c | 3 +-\n app/test-regex/main.c | 12 ++---\n app/test/test_cksum.c | 3 +-\n app/test/test_compressdev.c | 3 +-\n app/test/test_cryptodev.h | 3 +-\n app/test/test_cryptodev_asym.c | 3 +-\n app/test/test_cryptodev_blockcipher.c | 12 ++---\n app/test/test_func_reentrancy.c | 15 +++----\n app/test/test_hash.c | 15 +++----\n app/test/test_hash_perf.c | 7 +--\n app/test/test_link_bonding.c | 9 ++--\n app/test/test_link_bonding_mode4.c | 3 +-\n app/test/test_malloc.c | 5 +--\n app/test/test_mbuf.c | 45 +++++++------------\n app/test/test_pcapng.c | 3 +-\n app/test/test_reorder.c | 15 +++----\n app/test/virtual_pmd.c | 3 +-\n devtools/cocci/nullfree.cocci | 33 ++++++++++++++\n drivers/baseband/acc100/rte_acc100_pmd.c | 3 +-\n drivers/baseband/la12xx/bbdev_la12xx.c | 3 +-\n drivers/baseband/null/bbdev_null.c | 3 +-\n .../baseband/turbo_sw/bbdev_turbo_software.c | 3 +-\n drivers/bus/fslmc/fslmc_bus.c | 6 +--\n drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 6 +--\n drivers/bus/ifpga/ifpga_bus.c | 12 ++---\n drivers/bus/pci/pci_params.c | 3 +-\n drivers/bus/pci/windows/pci.c | 3 +-\n drivers/bus/pci/windows/pci_netuio.c | 3 +-\n drivers/common/cpt/cpt_ucode_asym.h | 6 +--\n drivers/common/dpaax/compat.h | 11 +----\n drivers/common/mlx5/mlx5_common_mr.c | 3 +-\n drivers/common/mlx5/mlx5_common_pci.c | 3 +-\n drivers/common/qat/qat_qp.c | 9 ++--\n drivers/compress/mlx5/mlx5_compress.c | 3 +-\n drivers/compress/octeontx/otx_zip_pmd.c | 9 ++--\n drivers/crypto/armv8/rte_armv8_pmd_ops.c | 3 +-\n drivers/crypto/ccp/ccp_dev.c | 3 +-\n drivers/crypto/ccp/ccp_pmd_ops.c | 3 +-\n drivers/crypto/cnxk/cnxk_ae.h | 6 +--\n drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 6 +--\n drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 6 +--\n drivers/crypto/null/null_crypto_pmd_ops.c | 6 +--\n drivers/crypto/octeontx/otx_cryptodev_ops.c | 3 +-\n drivers/crypto/openssl/rte_openssl_pmd_ops.c | 6 +--\n drivers/crypto/scheduler/scheduler_pmd_ops.c | 6 +--\n drivers/crypto/virtio/virtqueue.c | 6 +--\n drivers/event/sw/sw_evdev.c | 3 +-\n drivers/net/axgbe/axgbe_rxtx.c | 6 +--\n drivers/net/bnx2x/bnx2x_rxtx.c | 6 +--\n drivers/net/bnxt/bnxt_ethdev.c | 3 +-\n drivers/net/bonding/rte_eth_bond_pmd.c | 3 +-\n drivers/net/cnxk/cnxk_ethdev.c | 6 +--\n drivers/net/cxgbe/cxgbe_main.c | 3 +-\n drivers/net/dpaa/dpaa_ethdev.c | 3 +-\n drivers/net/dpaa/fmlib/fm_lib.c | 3 +-\n drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-\n drivers/net/dpaa2/dpaa2_mux.c | 3 +-\n drivers/net/dpaa2/dpaa2_ptp.c | 3 +-\n drivers/net/ena/ena_ethdev.c | 18 +++-----\n drivers/net/hinic/hinic_pmd_ethdev.c | 3 +-\n drivers/net/hns3/hns3_rxtx.c | 9 ++--\n drivers/net/i40e/i40e_ethdev.c | 27 ++++-------\n drivers/net/i40e/i40e_rxtx.c | 3 +-\n drivers/net/iavf/iavf_rxtx.c | 3 +-\n drivers/net/ice/ice_fdir_filter.c | 6 +--\n drivers/net/igc/igc_flow.c | 3 +-\n drivers/net/ixgbe/ixgbe_ethdev.c | 10 ++---\n drivers/net/ixgbe/ixgbe_rxtx.c | 3 +-\n drivers/net/memif/rte_eth_memif.c | 6 +--\n drivers/net/mlx4/mlx4_mr.c | 3 +-\n drivers/net/mlx5/mlx5_flow.c | 3 +-\n drivers/net/mvpp2/mrvl_qos.c | 3 +-\n drivers/net/netvsc/hn_rxtx.c | 6 +--\n drivers/net/null/rte_eth_null.c | 3 +-\n drivers/net/octeontx/octeontx_ethdev.c | 3 +-\n drivers/net/octeontx/octeontx_ethdev_ops.c | 3 +-\n drivers/net/qede/qede_main.c | 3 +-\n drivers/net/qede/qede_rxtx.c | 6 +--\n drivers/net/softnic/rte_eth_softnic_cli.c | 12 ++---\n .../net/softnic/rte_eth_softnic_cryptodev.c | 6 +--\n drivers/net/softnic/rte_eth_softnic_thread.c | 6 +--\n drivers/net/tap/tap_flow.c | 9 ++--\n drivers/net/txgbe/txgbe_ethdev.c | 12 ++---\n drivers/net/vdev_netvsc/vdev_netvsc.c | 3 +-\n drivers/net/virtio/virtio_user_ethdev.c | 12 ++---\n drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 3 +-\n drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 15 +++----\n drivers/raw/ifpga/ifpga_rawdev.c | 9 ++--\n drivers/raw/skeleton/skeleton_rawdev_test.c | 6 +--\n drivers/regex/cn9k/cn9k_regexdev.c | 6 +--\n drivers/regex/cn9k/cn9k_regexdev_compiler.c | 3 +-\n drivers/regex/mlx5/mlx5_regex.c | 3 +-\n drivers/regex/mlx5/mlx5_rxp.c | 3 +-\n drivers/vdpa/ifc/ifcvf_vdpa.c | 9 ++--\n drivers/vdpa/mlx5/mlx5_vdpa_mem.c | 3 +-\n drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 3 +-\n examples/fips_validation/fips_dev_self_test.c | 18 +++-----\n examples/fips_validation/fips_validation.c | 3 +-\n examples/fips_validation/main.c | 36 +++++----------\n examples/ip_pipeline/cli.c | 12 ++---\n examples/ip_pipeline/cryptodev.c | 6 +--\n examples/ip_pipeline/thread.c | 6 +--\n examples/l2fwd-cat/cat.c | 3 +-\n examples/pipeline/thread.c | 6 +--\n examples/vhost_blk/vhost_blk.c | 3 +-\n lib/compressdev/rte_compressdev.c | 3 +-\n lib/eal/common/eal_common_devargs.c | 6 +--\n lib/eal/common/eal_common_memzone.c | 3 +-\n lib/eal/common/eal_common_options.c | 9 ++--\n lib/eal/common/eal_common_trace_ctf.c | 6 +--\n lib/eal/freebsd/eal.c | 4 +-\n lib/eal/linux/eal.c | 10 ++---\n lib/eal/windows/eal_alarm.c | 3 +-\n lib/eal/windows/eal_memory.c | 3 +-\n lib/ethdev/rte_ethdev.c | 3 +-\n lib/graph/graph_stats.c | 3 +-\n lib/ipsec/ipsec_sad.c | 3 +-\n lib/port/rte_port_source_sink.c | 21 +++------\n lib/power/rte_power_empty_poll.c | 3 +-\n lib/reorder/rte_reorder.c | 6 +--\n lib/vhost/iotlb.c | 3 +-\n lib/vhost/vhost_crypto.c | 6 +--\n lib/vhost/vhost_user.c | 9 ++--\n 131 files changed, 306 insertions(+), 557 deletions(-)\n create mode 100644 devtools/cocci/nullfree.cocci", "diff": null, "prefixes": [ "00/82" ] }{ "id": 106239, "url": "