Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754069AbcKNJ5g (ORCPT ); Mon, 14 Nov 2016 04:57:36 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:64076 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752739AbcKNJ4E (ORCPT ); Mon, 14 Nov 2016 04:56:04 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Mon, 14 Nov 2016 09:55:48 +0000 From: Chris Wilson To: Tvrtko Ursulin Cc: Intel-gfx@lists.freedesktop.org, Tomasz Stanislawski , Pawel Osciak , linux-kernel@vger.kernel.org, Masahiro Yamada , Kyungmin Park , Matt Porter , linux-media@vger.kernel.org, Alexandre Bounine , Marek Szyprowski Subject: Re: [Intel-gfx] [PATCH 1/4] lib/scatterlist: Fix offset type in sg_alloc_table_from_pages Message-ID: <20161114095548.GC32240@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Tvrtko Ursulin , Intel-gfx@lists.freedesktop.org, Tomasz Stanislawski , Pawel Osciak , linux-kernel@vger.kernel.org, Masahiro Yamada , Kyungmin Park , Matt Porter , linux-media@vger.kernel.org, Alexandre Bounine , Marek Szyprowski References: <1478854220-3255-1-git-send-email-tvrtko.ursulin@linux.intel.com> <1478854220-3255-2-git-send-email-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1478854220-3255-2-git-send-email-tvrtko.ursulin@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1421 Lines: 38 On Fri, Nov 11, 2016 at 08:50:17AM +0000, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Scatterlist entries have an unsigned int for the offset so > correct the sg_alloc_table_from_pages function accordingly. > > Since these are offsets withing a page, unsigned int is > wide enough. > > Also converts callers which were using unsigned long locally > with the lower_32_bits annotation to make it explicitly > clear what is happening. > > v2: Use offset_in_page. (Chris Wilson) > > Signed-off-by: Tvrtko Ursulin > Cc: Masahiro Yamada > Cc: Pawel Osciak > Cc: Marek Szyprowski > Cc: Kyungmin Park > Cc: Tomasz Stanislawski > Cc: Matt Porter > Cc: Alexandre Bounine > Cc: linux-media@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Acked-by: Marek Szyprowski (v1) If there were kerneldoc, it would nicely explain that having an offset larger then a page is silly when passing in array of pages. Changes elsewhere look ok (personally I'd be happy with just offset_in_page(), 4GiB superpages are somebody else's problem :) Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre