Received: by 10.223.164.202 with SMTP id h10csp591443wrb; Thu, 30 Nov 2017 04:30:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMbAt265GcpuoPVs8m1LdQDCKFPwd8qC5Qukg2INq1A1ZwoAVOvN3SxZfjEYIrEK9yiTJcTH X-Received: by 10.99.96.195 with SMTP id u186mr2182609pgb.298.1512045052919; Thu, 30 Nov 2017 04:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512045052; cv=none; d=google.com; s=arc-20160816; b=GBM87k05eURCNcKVfxPDBa8Mchg+3OuvyVrA3nP3txdL0HZENiqYaL1fzXlhmEZmPf DpbFhjKlfQrcaIkHf6HXMOFcsDSplPCV6pOdqk3BxH4JaIUPfuM+fwpMT3X/jy8Z/evz rwKa58PraZin0WPasHrKR3E1MBueOnboMn/Etf3OzIpC2NrCyTQhMEeO7CQUvuL9OTjl eXKeQGo1zeydCGqijJLxlSWvFoAB0ZDr37Wwu+icaMmiL2XOkBmdxwtUVDsMGuVwOZ6G l+lh+hIX81Ju3mZ6ESsoclCdYc+UA0dUBBiB3Kgkdq+2/5Oys8FTh0HAVoijNYlydvSD SwKg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=vcWfvGNR5juCA5Q/v1Ar0bP8NrJiDqo/peq+ZkmD7IM=; b=E6axBFVmXNZyG3Lzb220IIeKJI/rpzLeTjHnY3us6WMHGdKWRCONMKo1eFrOmdK7Zc Zz2kUNjFAEN1TkkT6V028msGxt6CQU1Zxcg+SJLsUnbuOTtUMiLncRn+OfVR4zEymRh9 LzuAVZu423I6BUkWozQN15L7bBU81dzdqkoiXGiVwNVq9TvasQYd+6pgPyRYH2NM5fPm TMujfCE3UdAzxJfjsBPpo/mH1L2Sbvq94rIloLR5MMnBub8wKM0YnI6+DrXqTxuPev9I cL7acStf4DbL0WGD+uGPwstatwvzXvwwxkecxnTZBvIVCzRVigje4YB0/mdE4uSVLbsn fPMg== 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 u85si3159466pfi.278.2017.11.30.04.30.38; Thu, 30 Nov 2017 04:30:52 -0800 (PST) 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 S1752350AbdK3M3y (ORCPT + 99 others); Thu, 30 Nov 2017 07:29:54 -0500 Received: from osg.samsung.com ([64.30.133.232]:37268 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750723AbdK3M3w (ORCPT ); Thu, 30 Nov 2017 07:29:52 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 33294326FB; Thu, 30 Nov 2017 04:29:52 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fw6OFr92QHTo; Thu, 30 Nov 2017 04:29:51 -0800 (PST) Received: from vento.lan (unknown [179.182.167.145]) by osg.samsung.com (Postfix) with ESMTPSA id 520C7326F2; Thu, 30 Nov 2017 04:29:49 -0800 (PST) Date: Thu, 30 Nov 2017 10:29:46 -0200 From: Mauro Carvalho Chehab To: Sean Young , Stefani Seibold , Andrew Morton Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap Subject: Re: [PATCH v3 26/26] kfifo: DECLARE_KIFO_PTR(fifo, u64) does not work on arm 32 bit Message-ID: <20171130102946.7168e93c@vento.lan> In-Reply-To: <1507622382.6064.2.camel@seibold.net> References: <1507622382.6064.2.camel@seibold.net> Organization: Samsung X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 10 Oct 2017 09:59:42 +0200 Sean Young escreveu: > If you try to store u64 in a kfifo (or a struct with u64 members), > then the buf member of __STRUCT_KFIFO_PTR will cause 4 bytes > padding due to alignment (note that struct __kfifo is 20 bytes > on 32 bit). > > That in turn causes the __is_kfifo_ptr() to fail, which is caught > by kfifo_alloc(), which now returns EINVAL. > > So, ensure that __is_kfifo_ptr() compares to the right structure. > > Signed-off-by: Sean Young > Acked-by: Stefani Seibold Hi Stefani/Andrew, As this patch is required for the LIRC rework, would be ok if I would merge it via the media tree? Thanks! Mauro > > --- > include/linux/kfifo.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h > index 41eb6fdf87a8..86b5fb08e96c 100644 > --- a/include/linux/kfifo.h > +++ b/include/linux/kfifo.h > @@ -113,7 +113,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void); > * array is a part of the structure and the fifo type where the array is > * outside of the fifo structure. > */ > -#define __is_kfifo_ptr(fifo) (sizeof(*fifo) == sizeof(struct __kfifo)) > +#define __is_kfifo_ptr(fifo) \ > + (sizeof(*fifo) == sizeof(STRUCT_KFIFO_PTR(typeof(*(fifo)->type)))) > > /** > * DECLARE_KFIFO_PTR - macro to declare a fifo pointer object Thanks, Mauro From 1580859766276255754@xxx Tue Oct 10 08:49:16 +0000 2017 X-GM-THRID: 1580854157673854968 X-Gmail-Labels: Inbox,Category Forums