From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5309142CB3; Wed, 14 Jun 2023 16:31:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F92B42D1D; Wed, 14 Jun 2023 16:31:23 +0200 (CEST) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mails.dpdk.org (Postfix) with ESMTP id 079EE427F2 for ; Wed, 14 Jun 2023 16:31:22 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id ECBCB3200915; Wed, 14 Jun 2023 10:31:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 14 Jun 2023 10:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1686753080; x= 1686839480; bh=YkcS6wMmrcZrdjt0dMoFqWSCDlbXmt8Tu7blt4B6zAw=; b=a SygDmK6dMuurQ6JUyEMo8VgPLB6FAYjNjpdrSWTyV/g5On5sc/JDbhI/CAy2OcGX LkrV+kzjXIiURkVYIBZenwMdrDx4H2D7IPRJUc59wKQsFhUfsIbWVYvjIHN9cHxd xxieiGgZtqDsfW4wiMMgv1ydzogorhsIekG7vgeJvsvBSQ3hG8nOqH5QrcF7haKH sAP7rI+GbnF3U6O290SMXNPIzH1w+Ch6SFXVvhT6o3LiPaZPA1CmfuJFYxWedmQf Zr2kFPDL5p08luEXD6UDmdu64BCFHNvzTpnVzaqCI89ZPizMVmQtqOPvo8MpSyJy mzglKUx5qjFdWSe27YJzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1686753080; x= 1686839480; bh=YkcS6wMmrcZrdjt0dMoFqWSCDlbXmt8Tu7blt4B6zAw=; b=G llaFhxwj2K+QMbTLCahbHNTicSbcUVBn8pti5Sa49h/46ungig9zij21ugczui6a 1+GhXj/1HB3uGpl5RQNua/p1CGNoRMvbNTzkPnwZnnY7KxmaM3N6qEmt/0taHomK 6FLmdONj3pZk+NcQuO72vrF4SuTlTaECKagJHyqMD34Or6nH07qcxHWLC4SdHHQ8 lEW0EyiVhtZgCO6TCylijf3+lXZkB3PwamR5IXvyXy4xX7OtFMa+n44Su0cy8p4N l1aBxsVAl5ltzMWU5Kq8cmu9bgq8PTVYo/H4Zf7Ajc7dCtl/JIV8Iebgy9bNx3al 6epHJxElM/m0jmrs6gN9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedvtddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jun 2023 10:31:19 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Konstantin Ananyev , Akhil Goyal , Fan Zhang Subject: [PATCH 4/5] lib: restrict use of keyword extern Date: Wed, 14 Jun 2023 16:26:50 +0200 Message-Id: <20230614142651.1456116-5-thomas@monjalon.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614142651.1456116-1-thomas@monjalon.net> References: <20230614142651.1456116-1-thomas@monjalon.net> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Variable declarations in header files are using extern, it is valid. But function declarations do not need the keyword extern. Also, extern "C" should have a space after the keyword extern. Signed-off-by: Thomas Monjalon --- lib/acl/acl.h | 2 +- lib/bpf/bpf_impl.h | 8 ++++---- lib/cryptodev/cryptodev_pmd.h | 2 +- lib/cryptodev/rte_crypto.h | 2 +- lib/cryptodev/rte_cryptodev.h | 35 +++++++++++++++++------------------ lib/eal/include/rte_hexdump.h | 2 +- lib/security/rte_security.h | 6 +++--- 7 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lib/acl/acl.h b/lib/acl/acl.h index f5739a475c..c8e4e72fab 100644 --- a/lib/acl/acl.h +++ b/lib/acl/acl.h @@ -6,7 +6,7 @@ #define _ACL_H_ #ifdef __cplusplus -extern"C" { +extern "C" { #endif /* __cplusplus */ #define RTE_ACL_QUAD_MAX 5 diff --git a/lib/bpf/bpf_impl.h b/lib/bpf/bpf_impl.h index 3e067c1ff4..b483569071 100644 --- a/lib/bpf/bpf_impl.h +++ b/lib/bpf/bpf_impl.h @@ -21,10 +21,10 @@ struct rte_bpf { * Use '__rte' prefix for non-static internal functions * to avoid potential name conflict with other libraries. */ -extern int __rte_bpf_validate(struct rte_bpf *bpf); -extern int __rte_bpf_jit(struct rte_bpf *bpf); -extern int __rte_bpf_jit_x86(struct rte_bpf *bpf); -extern int __rte_bpf_jit_arm64(struct rte_bpf *bpf); +int __rte_bpf_validate(struct rte_bpf *bpf); +int __rte_bpf_jit(struct rte_bpf *bpf); +int __rte_bpf_jit_x86(struct rte_bpf *bpf); +int __rte_bpf_jit_arm64(struct rte_bpf *bpf); extern int rte_bpf_logtype; diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index 585c29df8a..8710ed7558 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -534,7 +534,7 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id); * - 0 on success, negative on error */ __rte_internal -extern int +int rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev); diff --git a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h index 7c9c413349..9b8d0331a4 100644 --- a/lib/cryptodev/rte_crypto.h +++ b/lib/cryptodev/rte_crypto.h @@ -216,7 +216,7 @@ __rte_crypto_op_get_priv_data_size(struct rte_mempool *mempool) * - On success pointer to mempool * - On failure NULL */ -extern struct rte_mempool * +struct rte_mempool * rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type, unsigned nb_elts, unsigned cache_size, uint16_t priv_size, int socket_id); diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index be708edc0f..ba730373fb 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -545,8 +545,7 @@ rte_cryptodev_asym_get_xform_string(enum rte_crypto_asym_xform_type xform_enum); * @return * The name of this flag, or NULL if it's not a valid feature flag. */ - -extern const char * +const char * rte_cryptodev_get_feature_name(uint64_t flag); /** Crypto device information */ @@ -662,7 +661,7 @@ struct rte_cryptodev_stats { * - Returns crypto device identifier on success. * - Return -1 on failure to find named crypto device. */ -extern int +int rte_cryptodev_get_dev_id(const char *name); /** @@ -675,7 +674,7 @@ rte_cryptodev_get_dev_id(const char *name); * - Returns crypto device name. * - Returns NULL if crypto device is not present. */ -extern const char * +const char * rte_cryptodev_name_get(uint8_t dev_id); /** @@ -685,7 +684,7 @@ rte_cryptodev_name_get(uint8_t dev_id); * @return * - The total number of usable crypto devices. */ -extern uint8_t +uint8_t rte_cryptodev_count(void); /** @@ -696,7 +695,7 @@ rte_cryptodev_count(void); * @return * Returns number of crypto device. */ -extern uint8_t +uint8_t rte_cryptodev_device_count_by_driver(uint8_t driver_id); /** @@ -723,7 +722,7 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices, * a default of zero if the socket could not be determined. * -1 if returned is the dev_id value is out of range. */ -extern int +int rte_cryptodev_socket_id(uint8_t dev_id); /** Crypto device configuration structure */ @@ -756,7 +755,7 @@ struct rte_cryptodev_config { * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -extern int +int rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config); /** @@ -774,7 +773,7 @@ rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config); * - 0: Success, device started. * - <0: Error code of the driver device start function. */ -extern int +int rte_cryptodev_start(uint8_t dev_id); /** @@ -783,7 +782,7 @@ rte_cryptodev_start(uint8_t dev_id); * * @param dev_id The identifier of the device. */ -extern void +void rte_cryptodev_stop(uint8_t dev_id); /** @@ -795,7 +794,7 @@ rte_cryptodev_stop(uint8_t dev_id); * - 0 on successfully closing device * - <0 on failure to close device */ -extern int +int rte_cryptodev_close(uint8_t dev_id); /** @@ -819,7 +818,7 @@ rte_cryptodev_close(uint8_t dev_id); * - 0: Success, queue pair correctly set up. * - <0: Queue pair configuration failed */ -extern int +int rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id); @@ -847,7 +846,7 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id); * @return * - The number of configured queue pairs. */ -extern uint16_t +uint16_t rte_cryptodev_queue_pair_count(uint8_t dev_id); @@ -862,7 +861,7 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id); * - Zero if successful. * - Non-zero otherwise. */ -extern int +int rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats); /** @@ -870,7 +869,7 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats); * * @param dev_id The identifier of the device. */ -extern void +void rte_cryptodev_stats_reset(uint8_t dev_id); /** @@ -886,7 +885,7 @@ rte_cryptodev_stats_reset(uint8_t dev_id); * the last valid element has it's op field set to * RTE_CRYPTO_OP_TYPE_UNDEFINED. */ -extern void +void rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info); @@ -903,7 +902,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info); * - On success, zero. * - On failure, a negative value. */ -extern int +int rte_cryptodev_callback_register(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg); @@ -921,7 +920,7 @@ rte_cryptodev_callback_register(uint8_t dev_id, * - On success, zero. * - On failure, a negative value. */ -extern int +int rte_cryptodev_callback_unregister(uint8_t dev_id, enum rte_cryptodev_event_type event, rte_cryptodev_cb_fn cb_fn, void *cb_arg); diff --git a/lib/eal/include/rte_hexdump.h b/lib/eal/include/rte_hexdump.h index 009ce24c5c..59813f2096 100644 --- a/lib/eal/include/rte_hexdump.h +++ b/lib/eal/include/rte_hexdump.h @@ -28,7 +28,7 @@ extern "C" { * @param len * The number of bytes to dump out. */ -extern void +void rte_hexdump(FILE *f, const char *title, const void *buf, unsigned int len); /** diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index daef846d40..3b2df526ba 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -901,9 +901,9 @@ rte_security_session_fast_mdata_set(void *sess, uint64_t fdata) /** Function to call PMD specific function pointer set_pkt_metadata() */ __rte_experimental -extern int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance, - void *sess, - struct rte_mbuf *m, void *params); +int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance, + void *sess, + struct rte_mbuf *m, void *params); /** * Updates the buffer with device-specific defined metadata -- 2.40.1