[dpdk-dev,v4,03/23] rte_device: make driver pointer const

Message ID 1482332986-7599-4-git-send-email-jblunck@infradead.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel compilation fail Compilation issues

Commit Message

Jan Blunck Dec. 21, 2016, 3:09 p.m. UTC
  From: Stephen Hemminger <stephen@networkplumber.org>

The info in rte_device about driver is immutable and
shouldn't change.
Acked-by: Jan Blunck <jblunck@infradead.org>

Acked-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_eal/common/include/rte_dev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Shreyansh Jain Dec. 22, 2016, 7:18 a.m. UTC | #1
On Wednesday 21 December 2016 08:39 PM, Jan Blunck wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
>
> The info in rte_device about driver is immutable and
> shouldn't change.
> Acked-by: Jan Blunck <jblunck@infradead.org>
>
> Acked-by: Jan Blunck <jblunck@infradead.org>

Not being picky - but, multiple Acked-by can be removed when this is 
applied.

> ---
>  lib/librte_eal/common/include/rte_dev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 8840380..e5471a2 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -122,7 +122,7 @@ struct rte_driver;
>   */
>  struct rte_device {
>  	TAILQ_ENTRY(rte_device) next; /**< Next device */
> -	struct rte_driver *driver;    /**< Associated driver */
> +	const struct rte_driver *driver;/**< Associated driver */
>  	int numa_node;                /**< NUMA node connection */
>  	struct rte_devargs *devargs;  /**< Device user arguments */
>  };
>

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
  

Patch

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 8840380..e5471a2 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -122,7 +122,7 @@  struct rte_driver;
  */
 struct rte_device {
 	TAILQ_ENTRY(rte_device) next; /**< Next device */
-	struct rte_driver *driver;    /**< Associated driver */
+	const struct rte_driver *driver;/**< Associated driver */
 	int numa_node;                /**< NUMA node connection */
 	struct rte_devargs *devargs;  /**< Device user arguments */
 };