[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com>
Date: Fri, 19 Feb 2021 09:03:59 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Ian Abbott' <abbotti@....co.uk>,
Greg KH <gregkh@...uxfoundation.org>,
Atul Gopinathan <atulgopinathan@...il.com>
CC: "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] staging: comedi: cast to (unsigned int *)
> 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)
Powered by blists - more mailing lists