Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1333902pxb; Sat, 17 Apr 2021 14:23:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwODU1AQNU5dMf24JlVJtB9oh5PokAuG0fwq1jEwoxXzsw2B9GGgr8E8wMgOYc3dBd02GkG X-Received: by 2002:a50:ee88:: with SMTP id f8mr17550969edr.69.1618694607605; Sat, 17 Apr 2021 14:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618694607; cv=none; d=google.com; s=arc-20160816; b=iWq7AnjyBB2bb6MWUe+q/JPtQE21MyDz+NoFZH2LJssavThFatNckeYt/lS1u6j1rp O0V9RkvIaMq0Z8xOQvLxyCYVB60XcsDticy6kZRJ1cw+g9Z16Zgm0Wp4FQv4KHZrHuk2 wMYDNRnIkVQOnVCYSm+/1igfsiTI95kqKxbUsOb4X3yyVV15q6mpwwAfteyNTVyD/kyr H7gt0wuilzNyhE60aMeesmxxSEQZjtwgxva8+TzkSJq3tTAesc2LVJrSwnJct7Tkn6qv Bl2h1R3QQ8SlT/TtVh6O+mxDDtuRxuUixMEwfaVwIlLeTb8FIoBgrxbXc4p8THNm1vVW As8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=yJvc7b++kgWWMzx8gFFHkzMgp1tDaofg+3QiugUeXnw=; b=ayXWv3tCN19trLodxxpyFEZP/DbcBKLGkp2XxOGwXGS0D17uBUGUQyQdN8T9LjqkhA 8Y7Rw319njeWNMC+sjWbD20ZiChk5WSDAUtUR9W5fxFSevyDGqkM9qiZXTfYOzZUu2X5 YSHhJniogEKdDYSZUfcNla6qqtLOnm245TlmG9ykbX+I457/sD0ljma/rSqsHlCSkQKm HN2eK4dVKVzwSO9P/ePOJlZtCk7GMpdQw7qGXAGEOafdw0MDpn2hvgK3ZSK1az7yNzgb dTjqhn7KwPCHlmGsKWSnD8r9EL4snYM/uTJ7VqljuMTqz2ueAE03vawmCL9W8JqPakeZ O5sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si1723282edv.466.2021.04.17.14.23.02; Sat, 17 Apr 2021 14:23:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237127AbhDQVT2 convert rfc822-to-8bit (ORCPT + 99 others); Sat, 17 Apr 2021 17:19:28 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:30925 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237090AbhDQVT2 (ORCPT ); Sat, 17 Apr 2021 17:19:28 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-261-JBH8CRNiMlWoKO_dEnAufg-1; Sat, 17 Apr 2021 22:18:58 +0100 X-MC-Unique: JBH8CRNiMlWoKO_dEnAufg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 17 Apr 2021 22:18:57 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Sat, 17 Apr 2021 22:18:57 +0100 From: David Laight To: 'Matthew Wilcox' , "brouer@redhat.com" CC: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "netdev@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mips@vger.kernel.org" , "ilias.apalodimas@linaro.org" , "mcroce@linux.microsoft.com" , "grygorii.strashko@ti.com" , "arnd@kernel.org" , "hch@lst.de" , "linux-snps-arc@lists.infradead.org" , "mhocko@kernel.org" , "mgorman@suse.de" Subject: RE: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems Thread-Topic: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems Thread-Index: AQHXMzO/f1yRrc3ugkWz9MvyD1ZvgKq5Nwpg Date: Sat, 17 Apr 2021 21:18:57 +0000 Message-ID: <386d009232dc42bdaf83d4cc36b13864@AcuMS.aculab.com> References: <20210416230724.2519198-1-willy@infradead.org> <20210416230724.2519198-2-willy@infradead.org> <20210417024522.GP2531743@casper.infradead.org> In-Reply-To: <20210417024522.GP2531743@casper.infradead.org> 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox > Sent: 17 April 2021 03:45 > > Replacement patch to fix compiler warning. ... > static inline dma_addr_t page_pool_get_dma_addr(struct page *page) > { > - return page->dma_addr; > + dma_addr_t ret = page->dma_addr[0]; > + if (sizeof(dma_addr_t) > sizeof(unsigned long)) > + ret |= (dma_addr_t)page->dma_addr[1] << 16 << 16; Ugly as well. Why not just replace the (dma_addr_t) cast with a (u64) one? Looks better than the double shift. Same could be done for the '>> 32'. Is there an upper_32_bits() that could be used?? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)