From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 705BDC433E0 for ; Fri, 19 Feb 2021 09:09:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B03B64EB1 for ; Fri, 19 Feb 2021 09:09:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbhBSJI2 (ORCPT ); Fri, 19 Feb 2021 04:08:28 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:47419 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbhBSJFq (ORCPT ); Fri, 19 Feb 2021 04:05:46 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-136-qCYCaDnfMe-HUtdo3zZNoQ-1; Fri, 19 Feb 2021 09:03:59 +0000 X-MC-Unique: qCYCaDnfMe-HUtdo3zZNoQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 19 Feb 2021 09:03:59 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Fri, 19 Feb 2021 09:03:59 +0000 From: David Laight To: 'Ian Abbott' , Greg KH , Atul Gopinathan CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] staging: comedi: cast to (unsigned int *) Thread-Topic: [PATCH] staging: comedi: cast to (unsigned int *) Thread-Index: AQHXBghs86N7pNMIM0eNnSVMq+7RAqpfL5hQ Date: Fri, 19 Feb 2021 09:03:59 +0000 Message-ID: <21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com> References: <20210217165907.9777-1-atulgopinathan@gmail.com> <20210217181000.GB10124@atulu-ubuntu> <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk> In-Reply-To: <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PiBJdCdzIGtpbmQgb2YgbW9vdCBhbnl3YXkgYmVjYXVzZSB0aGUgcGF0Y2ggaXMgb3V0ZGF0ZWQu ICBCdXQgdGhlIHJlYXNvbg0KPiBmb3IgdGhlIF9fX2ZvcmNlIGlzIHRoYXQgdGhlIHNhbWUgYHN0 cnVjdCBjb21lZGlfY21kYCBpcyB1c2VkIGluIGJvdGgNCj4gdXNlciBhbmQga2VybmVsIGNvbnRl eHRzLiAgSW4gdXNlciBjb250ZXh0cywgdGhlIGBjaGFubGlzdGAgbWVtYmVyDQo+IHBvaW50cyB0 byB1c2VyIG1lbW9yeSBhbmQgaW4ga2VybmVsIGNvbnRleHRzIGl0IHBvaW50cyB0byBrZXJuZWwg bWVtb3J5DQo+IChjb3BpZWQgZnJvbSB1c2Vyc3BhY2UpLg0KDQpDYW4ndCB5b3UgdXNlIGEgdW5p b24gb2YgdGhlIHVzZXIgYW5kIGtlcm5lbCBwb2ludGVycz8NCihQb3NzaWJseSBldmVuIGFub255 bW91cz8pDQpBbHRob3VnaCwgaWRlYWxseSwga2VlcGluZyB0aGVtIGluIHNlcGFyYXRlIGZpZWxk cyBpcyBiZXR0ZXIuDQo4IGJ5dGVzIGZvciBhIHBvaW50ZXIgaXNuJ3QgZ29pbmcgbWFrZSBhIGZh dCBsb3Qgb2YgZGlmZmVyZW5jZS4NCg0KCURhdmlkDQoNCi0NClJlZ2lzdGVyZWQgQWRkcmVzcyBM YWtlc2lkZSwgQnJhbWxleSBSb2FkLCBNb3VudCBGYXJtLCBNaWx0b24gS2V5bmVzLCBNSzEgMVBU LCBVSw0KUmVnaXN0cmF0aW9uIE5vOiAxMzk3Mzg2IChXYWxlcykNCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_20, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D602C433DB for ; Fri, 19 Feb 2021 09:04:12 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D034564ED5 for ; Fri, 19 Feb 2021 09:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D034564ED5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5B42187470; Fri, 19 Feb 2021 09:04:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WiKrY8SbUsNP; Fri, 19 Feb 2021 09:04:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2987987478; Fri, 19 Feb 2021 09:04:08 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 87F0A1BF9CB for ; Fri, 19 Feb 2021 09:04:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8331286B7C for ; Fri, 19 Feb 2021 09:04:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n8oOOmrE0LV6 for ; Fri, 19 Feb 2021 09:04:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E6A0186B7A for ; Fri, 19 Feb 2021 09:04:03 +0000 (UTC) Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-136-qCYCaDnfMe-HUtdo3zZNoQ-1; Fri, 19 Feb 2021 09:03:59 +0000 X-MC-Unique: qCYCaDnfMe-HUtdo3zZNoQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 19 Feb 2021 09:03:59 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Fri, 19 Feb 2021 09:03:59 +0000 From: David Laight To: 'Ian Abbott' , Greg KH , Atul Gopinathan Subject: RE: [PATCH] staging: comedi: cast to (unsigned int *) Thread-Topic: [PATCH] staging: comedi: cast to (unsigned int *) Thread-Index: AQHXBghs86N7pNMIM0eNnSVMq+7RAqpfL5hQ Date: Fri, 19 Feb 2021 09:03:59 +0000 Message-ID: <21a953261eb44e7ba302cfe74d8efa2d@AcuMS.aculab.com> References: <20210217165907.9777-1-atulgopinathan@gmail.com> <20210217181000.GB10124@atulu-ubuntu> <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk> In-Reply-To: <3cfef23d-8d4a-205c-61e8-cbe8c9a0c0f4@mev.co.uk> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" > 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