netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	fengguang.wu@intel.com, dcbw@redhat.com, jiri@resnulli.us,
	David.Laight@ACULAB.COM, marcel@holtmann.org
Subject: Re: [PATCH net-next 3/3 v5] drivers: net: ethernet: qualcomm: rmnet: Initial implementation
Date: Mon, 21 Aug 2017 21:08:53 -0700	[thread overview]
Message-ID: <20170821210853.4b1a150d@xeon-e3> (raw)
In-Reply-To: <1502931307-517-4-git-send-email-subashab@codeaurora.org>

> +void rmnet_vnd_setup(struct net_device *rmnet_dev)
> +{
> +	struct rmnet_priv *priv;
> +
> +	/* Clear out private data */
> +	priv = netdev_priv(rmnet_dev);
> +	memset(priv, 0, sizeof(struct rmnet_priv));

Netdev private area is always zero on creation. See alloc_netdev().


> +struct rmnet_endpoint *rmnet_vnd_get_endpoint(struct net_device *rmnet_dev)
> +{
> +	struct rmnet_priv *priv;
> +
> +	if (!rmnet_dev)
> +		return 0;

Do not confuse 0 with NULL. Did you run sparse?

> +
> +	priv = netdev_priv(rmnet_dev);
> +	if (!priv)
> +		return 0;


netdev_priv() always returns a non-NULL value.  The private area is just
a constant offset below the original network_device structure.

  parent reply	other threads:[~2017-08-22  4:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17  0:55 [PATCH net-next 0/3 v5] Add support for rmnet driver Subash Abhinov Kasiviswanathan
2017-08-17  0:55 ` [PATCH net-next 1/3 v5] net: ether: Add support for multiplexing and aggregation type Subash Abhinov Kasiviswanathan
2017-08-17  0:55 ` [PATCH net-next 2/3 v5] net: arp: Add support for raw IP device Subash Abhinov Kasiviswanathan
2017-08-17  0:55 ` [PATCH net-next 3/3 v5] drivers: net: ethernet: qualcomm: rmnet: Initial implementation Subash Abhinov Kasiviswanathan
2017-08-17  3:16   ` Dan Williams
2017-08-17  6:38     ` Subash Abhinov Kasiviswanathan
2017-08-19 12:56   ` kbuild test robot
2017-08-22  4:08   ` Stephen Hemminger [this message]
2017-08-22  5:34     ` Subash Abhinov Kasiviswanathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170821210853.4b1a150d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=dcbw@redhat.com \
    --cc=fengguang.wu@intel.com \
    --cc=jiri@resnulli.us \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).