Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3573844imm; Mon, 20 Aug 2018 00:37:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwUWdvvaljVvdfKF7Ut142/NuFFMthJfCgltj+RjTJw71FjGMOKYWVtXmNjS4lAbTxGk7Sm X-Received: by 2002:a17:902:b60e:: with SMTP id b14-v6mr43979365pls.111.1534750646799; Mon, 20 Aug 2018 00:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534750646; cv=none; d=google.com; s=arc-20160816; b=LyD0ivzhFKGVNbGOJEzFwlExy/W7uRuBn/O5LDAkltv3tP1l83pcLnOahEUkmr2aWu BUk2K5mjGQrFk0OxVovqSrJ0wzbF/Slby8DXYfccAdU/fP8T1HgrB8H04iY09OwvCSzs lbJIY3RWao+VjP1bmMLkFiUCI/87AFOwKyfwKrCVT2VQJpyCa2rWu4YJUEGJAjcAgK2M JV9k7rhtAuSWiUTwv/eKkzqiMI7UrJTQ+XhbtDI7PsW+Fag3wtcdULyYKRlB6/0lEIBd //smirFhum7Qu4TM3HSz329E9JB5NEp7PfPAliR7G4Vpyw0m6R8XklBAn+E4hIBBmRUw zOkg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=BH66WabL7OyAbi2Zn7VrVIZdTp0G3cBXQf3ukYai08g=; b=LAPKXLK6cXCdjjbAfdT3dTHPTpFfEIUEFWZmipOYXs9vIFRSQ18E0YopK/nAlldtrL 7ft6wibXN/0oZ5215NYTUV6JiM726xH5XYDoOfNUAMbswijvsX2hi20SqYKAytvwNjea E2sehIcQIPxv92ktdmHvjvUjPoVr5jm3V7G+07DqfnPMBwNjWRt/ikM6InSMegGuicFU JnQlGVPMfpV465Ulte6RsdhZZ1Oci9CpbG1XLPYLLUfov8ImdFK4C83f/LWhvczxsgjG W63oPI4+fzs6tDcAst5tSVmQ4uY0UtqNHuf5WTIc0/nN1+fu+EAfK0Mae+jLLokM4lDf GpkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=QdBpDpB6; 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 gn16si8652650plb.69.2018.08.20.00.37.11; Mon, 20 Aug 2018 00:37:26 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=QdBpDpB6; 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 S1726198AbeHTKui (ORCPT + 99 others); Mon, 20 Aug 2018 06:50:38 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36343 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbeHTKuh (ORCPT ); Mon, 20 Aug 2018 06:50:37 -0400 Received: by mail-lj1-f194.google.com with SMTP id u7-v6so10814359lji.3 for ; Mon, 20 Aug 2018 00:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BH66WabL7OyAbi2Zn7VrVIZdTp0G3cBXQf3ukYai08g=; b=QdBpDpB6cjGGnfxIvOs9eBuBL3vREBaxxbRNK3mSPlz2LOskwe3sZD3iysnALer5BK paAak//sC/5J8Qq82wk1UMSa8ZLRtussChKQQTFK4U4MkZMO7aFRC9t/U64HRCDG7ffd 8QBzEdjCPQAfOwAroMcjwC/dH6ZZVXwRURILA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BH66WabL7OyAbi2Zn7VrVIZdTp0G3cBXQf3ukYai08g=; b=mtH9VyyiwGM8iNceHtr/mI8b7Mexx7NZdsnOT85gKbxA72SeqcAOVAwsXgbO+Bx6tj WbG4mjgTrwvgJBesCoHCv4Q6PEbji3XyPBimldrozmcqqVJfhsV1wlTd5bMOn6Cy8KL8 oSmOEHn7psJuII97b9dDQioSJy1d1mpAhOp3MUqu1aa5B1YtWheyxaeRFSd511/0F2qh YpqhLiv/hXEzwDVoC0IGFzCSA/m3VXiTeg5KsqZej4mq56epLxPFS7BegBF65sfn4KJO r95vvJotH0xqmWC51S6pjg9k7Eef1Wg73CO0nc3KkIgWGyfDLKbpaQ9r/hb7GLjucEMi 5hvQ== X-Gm-Message-State: AOUpUlHl3F1Jqup6zs2NmOOGh3b+vqUZOIeguzQbIHQfxdWKdnpb9KA2 haov659J7hZfLHv6x8ZOu8wZcn6R9W+xPA== X-Received: by 2002:a2e:9599:: with SMTP id w25-v6mr7673492ljh.6.1534750563309; Mon, 20 Aug 2018 00:36:03 -0700 (PDT) Received: from [172.16.11.40] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id z21-v6sm1471503ljb.59.2018.08.20.00.36.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 00:36:02 -0700 (PDT) Subject: Re: [PATCH 6/7] lib/bitmap.c: fix remaining space computation in bitmap_print_to_pagebuf To: Andy Shevchenko Cc: Andrew Morton , Yury Norov , Andy Shevchenko , Sudeep Holla , Linux Kernel Mailing List References: <20180818131623.8755-1-linux@rasmusvillemoes.dk> <20180818131623.8755-7-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: <238a1f81-03f3-19cf-86a9-2a36af0e8093@rasmusvillemoes.dk> Date: Mon, 20 Aug 2018 09:36:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-08-19 14:37, Andy Shevchenko wrote: > On Sat, Aug 18, 2018 at 4:17 PM Rasmus Villemoes > wrote: >> >> int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp, >> int nmaskbits) >> { >> - ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf; >> + ptrdiff_t len = PAGE_SIZE - ((unsigned long)buf & (PAGE_SIZE-1)); > > Don't we have offset_in_page() helper macro? Indeed, thanks! Andrew, if you pick this up, can you use the much more obvious PAGE_SIZE - offset_in_page(buf) instead? bitmap.c already (unsurprisingly) includes mm.h through some recursive path. Rasmus