From: Johannes Berg <johannes@sipsolutions.net>
To: Prasun Maiti <prasunmaiti87@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Dibyajyoti Ghosh <dibyajyotig@gmail.com>,
Ujjal Roy <royujjal@gmail.com>,
WiFi Mailing List <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel
Date: Tue, 31 May 2016 12:25:45 +0200 [thread overview]
Message-ID: <1464690345.3076.17.camel@sipsolutions.net> (raw)
In-Reply-To: <1464248432-12595-1-git-send-email-prasunmaiti87@gmail.com> (sfid-20160526_094047_190562_9918B3AC)
Hi,
I must say, this is a bit of a surprise - where is iwpriv actually
still relevant? What driver could this possibly matter for?
Anyway ...
> + if (dev->netdev_ops->ndo_do_ioctl) {
> + if ((info->flags & IW_REQUEST_FLAG_COMPAT) &&
> + (cmd >= SIOCIWFIRSTPRIV && cmd <=
> SIOCIWLASTPRIV)) {
This has coding style issues, obviously.
Also, handling the non-compat case would allow you to return and reduce
indentation by one in the large code block that handles the compat.
> + int ret = 0;
> + struct compat_iw_point *iwp_compat = (struct compat_iw_point *) &iwr->u.data;
> + struct iw_point *iwp = &iwr->u.data;
> + __u16 length = iwp_compat->length, flags = iwp_compat->flags;
> +
> + iwp->pointer = compat_ptr(iwp_compat->pointer);
> + iwp->length = length;
> + iwp->flags = flags;
> +
> + ret = dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
> +
> + length = iwp->length;
> + flags = iwp->flags;
> + iwp_compat->pointer = ptr_to_compat(iwp->pointer);
> + iwp_compat->length = length;
> + iwp_compat->flags = flags;
Why don't you just put another ifr/iwr on the stack, and use that to
pass things to the driver? This modify-in-place of 'iwp', which
requires loading all the variables first, seems very awkward to me.
johannes
next prev parent reply other threads:[~2016-05-31 10:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 7:40 [PATCH] wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel Prasun Maiti
2016-05-31 10:25 ` Johannes Berg [this message]
2016-06-03 9:24 ` Prasun Maiti
2016-06-03 18:47 ` Johannes Berg
2016-06-04 4:50 ` wext: making deprecation more visible Kalle Valo
2016-06-07 7:13 ` Johannes Berg
2016-06-06 14:34 ` [PATCH] wext: Fix 32 bit iwpriv compatibility issue with 64 bit Kernel Prasun Maiti
2016-06-09 7:57 ` Johannes Berg
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=1464690345.3076.17.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=dibyajyotig@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=prasunmaiti87@gmail.com \
--cc=royujjal@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.