All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Ian Abbott' <abbotti@mev.co.uk>,
	Greg KH <gregkh@linuxfoundation.org>,
	Atul Gopinathan <atulgopinathan@gmail.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] staging: comedi: cast to (unsigned int *)
Date: Fri, 19 Feb 2021 09:03:59 +0000	[thread overview]
Message-ID: <21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com> (raw)
In-Reply-To: <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk>

> It's kind of moot anyway because the patch is outdated.  But the reason
> for the ___force is that the same `struct comedi_cmd` is used in both
> user and kernel contexts.  In user contexts, the `chanlist` member
> points to user memory and in kernel contexts it points to kernel memory
> (copied from userspace).

Can't you use a union of the user and kernel pointers?
(Possibly even anonymous?)
Although, ideally, keeping them in separate fields is better.
8 bytes for a pointer isn't going make a fat lot of difference.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

WARNING: multiple messages have this Message-ID (diff)
From: David Laight <David.Laight@ACULAB.COM>
To: 'Ian Abbott' <abbotti@mev.co.uk>,
	Greg KH <gregkh@linuxfoundation.org>,
	Atul Gopinathan <atulgopinathan@gmail.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] staging: comedi: cast to (unsigned int *)
Date: Fri, 19 Feb 2021 09:03:59 +0000	[thread overview]
Message-ID: <21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com> (raw)
In-Reply-To: <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk>

> It's kind of moot anyway because the patch is outdated.  But the reason
> for the ___force is that the same `struct comedi_cmd` is used in both
> user and kernel contexts.  In user contexts, the `chanlist` member
> points to user memory and in kernel contexts it points to kernel memory
> (copied from userspace).

Can't you use a union of the user and kernel pointers?
(Possibly even anonymous?)
Although, ideally, keeping them in separate fields is better.
8 bytes for a pointer isn't going make a fat lot of difference.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2021-02-19  9:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 16:59 [PATCH] staging: comedi: cast to (unsigned int *) Atul Gopinathan
2021-02-17 16:59 ` Atul Gopinathan
2021-02-17 17:35 ` Greg KH
2021-02-17 17:35   ` Greg KH
2021-02-17 18:10   ` Atul Gopinathan
2021-02-17 18:10     ` Atul Gopinathan
2021-02-17 18:26     ` Greg KH
2021-02-17 18:26       ` Greg KH
2021-02-18 11:04       ` Ian Abbott
2021-02-18 11:04         ` Ian Abbott
2021-02-19  9:03         ` David Laight [this message]
2021-02-19  9:03           ` David Laight
2021-02-19  9:26           ` Dan Carpenter
2021-02-19  9:26             ` Dan Carpenter
2021-02-19  9:36             ` David Laight
2021-02-19  9:36               ` David Laight
2021-02-19  9:31           ` Ian Abbott
2021-02-19  9:31             ` Ian Abbott

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=21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=abbotti@mev.co.uk \
    --cc=atulgopinathan@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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 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.