Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp534486ybl; Wed, 28 Aug 2019 01:29:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHj0QBlTnXYZ03RJNt2CXOjt+yXwMtYsBoTiWWc2inKDaQahwj0b43vK0ft/cmwczt0IHW X-Received: by 2002:aa7:957a:: with SMTP id x26mr283819pfq.16.1566980946385; Wed, 28 Aug 2019 01:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566980946; cv=none; d=google.com; s=arc-20160816; b=iPGfxSjKuZ36esl3hXedMI0RRau2+zeOfsfGapIsCLNA+QKkzyBIQEeISApcejCxGV D6gj6aBOF10VzcB+M3ZGksdP+9BZZ2oMcjBr93JOsCgz5nEYb8yLerpJXrFTDwn+cxA+ B5YdTIUOg++ToOhu4U9RD9s0Rv3Uc6VxDNWy+YXoWpXdeaBGKXVDvIAt0L8WTyYnfWHP e9BMrCUdWIMttoZI/n5TIN/4zJRJVUJ4c+WSy7EgY6Jxjv/Ee+95Jw0hHLqgvEg3Tzg+ PP5AAwlbTN1g6AMhNYwdmdDR2lyYpkzOyxXxpEUmqP6olyCyDtzW21qnwtZv+VdhfXfL kgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=EYber9l48SMkBXafcbegOnhawUzBFSyX/is9FiWZmcE=; b=LF5eDZRnB1k0pwuCLP8k+k4c/hDDCj4twPYLUYrhrVtOjJjeb7pC5T0n3v+OlYheAf d0RaClIeNC13jviNJ/Mv2Vh1hr8a5yZN5PCKlu6lTiZ1/I24jJ16AtDTXnGb8aR+B9fd XL5mT++ayDEkSupsB9KYk6yUoFk8P+3Uj2dHDWxJ0bzIHodyxGmLvFBlIaYHu/V0syVM RyY9XAGKmhirvsAjRfGjyQ7jMiv6UAQbHcpcuL3cGL6WnLDkCpv3BybnXI+piPQmlLZU Jzg7jVNZXJaMEsTu4qOU49WB2hYwmFHwKrM41bdIfPDwiJ6gu+yQnFuhPj25h18zn+Qi elFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si1312094pjr.102.2019.08.28.01.28.50; Wed, 28 Aug 2019 01:29:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbfH1I1v convert rfc822-to-8bit (ORCPT + 99 others); Wed, 28 Aug 2019 04:27:51 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:37394 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbfH1I1v (ORCPT ); Wed, 28 Aug 2019 04:27:51 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-44-7Eyd5yFUMV6GmCf8-LeV7A-1; Wed, 28 Aug 2019 09:27:48 +0100 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; Wed, 28 Aug 2019 09:27:46 +0100 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; Wed, 28 Aug 2019 09:27:46 +0100 From: David Laight To: 'Joe Perches' , Geert Uytterhoeven , Al Viro , Andrew Morton CC: Bernard Metzler , Doug Ledford , Jason Gunthorpe , linux-rdma , Linux Kernel Mailing List Subject: RE: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse Thread-Topic: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse Thread-Index: AQHVXQXl4BhhBlFhpEW57H2RBHAQPacQOptA Date: Wed, 28 Aug 2019 08:27:45 +0000 Message-ID: References: <20190819100526.13788-1-geert@linux-m68k.org> <581e7d79ed75484beb227672b2695ff14e1f1e34.camel@perches.com> <20190827174639.GT1131@ZenIV.linux.org.uk> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: 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 X-MC-Unique: 7Eyd5yFUMV6GmCf8-LeV7A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joe Perches > Sent: 27 August 2019 19:33 > On Tue, 2019-08-27 at 19:59 +0200, Geert Uytterhoeven wrote: > > On Tue, Aug 27, 2019 at 7:46 PM Al Viro wrote: > > > On Tue, Aug 27, 2019 at 07:29:52PM +0200, Geert Uytterhoeven wrote: > > > > On Tue, Aug 27, 2019 at 4:17 PM David Laight wrote: > > > > > From: Geert Uytterhoeven > > > > > > Sent: 19 August 2019 18:15 > > > > > ... > > > > > > > I think a cast to unsigned long is rather more common. > > > > > > > > > > > > > > uintptr_t is used ~1300 times in the kernel. > > > > > > > I believe a cast to unsigned long is much more common. > > btw: apparently that's not true. > > This grep may be incomplete but it seems there are fewer > kernel uses of a cast to unsigned long then pointer: > > $ git grep -P '\(\s*\w+(\s+\w+){0,3}(\s*\*)+\s*\)\s*\(\s*unsigned\s+long\s*\)'|wc -l > 423 > > Maybe add a cast_to_ptr macro like > > #define cast_to_ptr(type, val) ((type)(uintptr_t)(val)) > > though that may not save any horizontal space And it is another bit of pointless obfuscation.... David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)