Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752695AbbBXUzL (ORCPT ); Tue, 24 Feb 2015 15:55:11 -0500 Received: from mail-qc0-f176.google.com ([209.85.216.176]:38476 "EHLO mail-qc0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbbBXUzK (ORCPT ); Tue, 24 Feb 2015 15:55:10 -0500 MIME-Version: 1.0 In-Reply-To: <1424807759-23311-1-git-send-email-dpetigara@broadcom.com> References: <1424807759-23311-1-git-send-email-dpetigara@broadcom.com> From: Gregory Fong Date: Tue, 24 Feb 2015 12:54:38 -0800 Message-ID: Subject: Re: [PATCH] mm: cma: fix CMA aligned offset calculation To: Danesh Petigara Cc: Andrew Morton , Marek Szyprowski , Michal Nazarewicz , Joonsoo Kim , "Aneesh Kumar K.V" , Laurent Pinchart , linux-mm@kvack.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 33 [removed stable from cc] On Tue, Feb 24, 2015 at 11:55 AM, Danesh Petigara wrote: > diff --git a/mm/cma.c b/mm/cma.c > index 75016fd..58f37bd 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -70,9 +70,13 @@ static unsigned long cma_bitmap_aligned_offset(struct cma *cma, int align_order) > > if (align_order <= cma->order_per_bit) > return 0; > - alignment = 1UL << (align_order - cma->order_per_bit); > - return ALIGN(cma->base_pfn, alignment) - > - (cma->base_pfn >> cma->order_per_bit); > + > + /* > + * Find a PFN aligned to the specified order and return > + * an offset represented in order_per_bits. > + */ > + return (ALIGN(cma->base_pfn, (1UL << align_order)) > + - cma->base_pfn) >> cma->order_per_bit; It was noticed that this doesn't remove the now-unused 'alignment' variable, so I think Danesh is planning to submit an updated patch. Best regards, Gregory -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/