From: Paul Fulghum <paulkf@microgate.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: netdev <netdev@oss.sgi.com>, jgarzik <jgarzik@pobox.com>
Subject: Re: [janitor] use netdev_priv() in synclink (char. driver)
Date: 05 Mar 2004 09:15:09 -0600 [thread overview]
Message-ID: <1078499709.2076.5.camel@deimos.microgate.com> (raw)
In-Reply-To: <20040303150105.7ff770b0.rddunlap@osdl.org>
On Wed, 2004-03-03 at 17:01, Randy.Dunlap wrote:
> |
> | From: Carlo Perassi <carlo@linux.it>
> | and Randy.Dunlap <rddunlap@osdl.org>
>
>
> Jeff, can you add this patch and the fusion/mptlan driver
> patch as well?
>
> --
> ~Randy
>
>
>
>
> linux-264-302-priv-rddunlap/drivers/char/synclink.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff -puN drivers/char/synclink.c~synclink_casts drivers/char/synclink.c
> --- linux-264-302-priv/drivers/char/synclink.c~synclink_casts 2004-03-02 12:56:23.000000000 -0800
> +++ linux-264-302-priv-rddunlap/drivers/char/synclink.c 2004-03-02 13:01:39.000000000 -0800
> @@ -7878,7 +7878,7 @@ void mgsl_sppp_delete(struct mgsl_struct
>
> int mgsl_sppp_open(struct net_device *d)
> {
> - struct mgsl_struct *info = d->priv;
> + struct mgsl_struct *info = netdev_priv(d);
> int err;
> unsigned long flags;
>
> @@ -7920,7 +7920,7 @@ open_fail:
>
> void mgsl_sppp_tx_timeout(struct net_device *dev)
> {
> - struct mgsl_struct *info = dev->priv;
> + struct mgsl_struct *info = netdev_priv(dev);
> unsigned long flags;
>
> if (debug_level >= DEBUG_LEVEL_INFO)
> @@ -7938,7 +7938,7 @@ void mgsl_sppp_tx_timeout(struct net_dev
>
> int mgsl_sppp_tx(struct sk_buff *skb, struct net_device *dev)
> {
> - struct mgsl_struct *info = dev->priv;
> + struct mgsl_struct *info = netdev_priv(dev);
> unsigned long flags;
>
> if (debug_level >= DEBUG_LEVEL_INFO)
> @@ -7964,7 +7964,7 @@ int mgsl_sppp_tx(struct sk_buff *skb, st
>
> int mgsl_sppp_close(struct net_device *d)
> {
> - struct mgsl_struct *info = d->priv;
> + struct mgsl_struct *info = netdev_priv(d);
> unsigned long flags;
>
> if (debug_level >= DEBUG_LEVEL_INFO)
> @@ -8014,7 +8014,7 @@ void mgsl_sppp_tx_done(struct mgsl_struc
>
> struct net_device_stats *mgsl_net_stats(struct net_device *dev)
> {
> - struct mgsl_struct *info = dev->priv;
> + struct mgsl_struct *info = netdev_priv(dev);
> if (debug_level >= DEBUG_LEVEL_INFO)
> printk("mgsl_net_stats(%s)\n",info->netname);
> return &info->netstats;
> @@ -8022,7 +8022,7 @@ struct net_device_stats *mgsl_net_stats(
>
> int mgsl_sppp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> {
> - struct mgsl_struct *info = (struct mgsl_struct *)dev->priv;
> + struct mgsl_struct *info = netdev_priv(dev);
> if (debug_level >= DEBUG_LEVEL_INFO)
> printk("%s(%d):mgsl_ioctl %s cmd=%08X\n", __FILE__,__LINE__,
> info->netname, cmd );
>
> _
This patch breaks the driver.
The pointer stored in dev->priv points to a structure that is
allocated and maintained by the driver.
Changing from dev->priv to netdev_priv(dev) returns a pointer
to memory at the end of the net_device structure.
These are two different things.
So with the patch, the driver gets a pointer to something
other than the device private information that it needs.
Please dont apply this patch.
--
Paul Fulghum
paulkf@microgate.com
next parent reply other threads:[~2004-03-05 15:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040303142907.09d0f7bd.rddunlap@osdl.org>
[not found] ` <20040303150105.7ff770b0.rddunlap@osdl.org>
2004-03-05 15:15 ` Paul Fulghum [this message]
2004-03-07 4:16 ` [janitor] use netdev_priv() in synclink (char. driver) Randy.Dunlap
[not found] ` <20040303145738.293f987d.rddunlap@osdl.org>
2004-03-12 18:37 ` [janitor] use netdev_priv() in drivers/net/ (others) Jeff Garzik
2004-03-04 21:20 [janitor] use netdev_priv() in synclink (char. driver) Randy.Dunlap
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=1078499709.2076.5.camel@deimos.microgate.com \
--to=paulkf@microgate.com \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
--cc=rddunlap@osdl.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).