Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp577599pxb; Wed, 6 Oct 2021 10:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7l2mveE4u5CvnYIFu85UdRThg1ypoFQTKMZmU97SE3BpnC0ZmkBLSzre6aq1Oub3q/Ihz X-Received: by 2002:a17:90a:bf91:: with SMTP id d17mr80581pjs.158.1633542663526; Wed, 06 Oct 2021 10:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633542663; cv=none; d=google.com; s=arc-20160816; b=VT3Y2xMRwAkEb2KPaLvAmWPuDqE0B7wUFJWA/QhxH3kgzZIp9Da6V+pl25s/WV6amm Cg66rIy+H1KxXzG2GXLvrCTVDV0zVWkNjTcFcxR3IlQjJLJzbhqvoUXnKmBfjhAOsvg6 jukMiBBqKuTT369wLfd6Lv/NnlXaEjEKJo/xs9qeLdR+BPfEpezCPV653aIg852fVHAK dQx+GYgQABvmQ0jktA3p8196VxQKmYFt1pwGB/YSAz/aKJ13iZrW2+WE15BExk+P5/mg 4k5sHjVC5AsSFRVeRZuRby27c1xU4Te6AYArDAVXwdWOKbxatQPDkSdk12G4bR2PB+x5 ssgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:references:from:subject:cc:to :date:dkim-signature; bh=XOrLreEsAuVDxgUxU0x2eSWaOLostnJXpsKIuIcC4bY=; b=XPaeMwchXfOept69XXcnqpIER+7CejlbSqBM16NAKHoySWHRx0W8gJNUPvt0gPBFoj 2AI1f/r/oBbIoN1/XLHIzNracZty+0Ekhl8mpnq943waLD5d2eJAGnO5bEI/Mt95Kd7Z s0eUyeUPsN0ePWtbMW+wAP5d7aeZTnMw2BcoWXfpOw7DRPUUJ/47IT9q8UUcpuYnNiBE lsNtp5ix5dPoPa3JbPYO7RVfUL5qXDR/JoXFkUaWgivx5vNYyBQQMYxcY1nvMhz1hA1P IqWETuamTuomN+ufI9ulfM47roOpSsex7vAI2wCmj67zRNlC9SRBMtm8YE51BF5bCS8c QpCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mforney-org.20210112.gappssmtp.com header.s=20210112 header.b=O64bnKH6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si36880394plh.453.2021.10.06.10.50.49; Wed, 06 Oct 2021 10:51:03 -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; dkim=pass header.i=@mforney-org.20210112.gappssmtp.com header.s=20210112 header.b=O64bnKH6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238485AbhJFRvX (ORCPT + 99 others); Wed, 6 Oct 2021 13:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239163AbhJFRvR (ORCPT ); Wed, 6 Oct 2021 13:51:17 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C797BC061764 for ; Wed, 6 Oct 2021 10:49:18 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id n2so2131129plk.12 for ; Wed, 06 Oct 2021 10:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20210112.gappssmtp.com; s=20210112; h=date:to:cc:subject:from:references:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=XOrLreEsAuVDxgUxU0x2eSWaOLostnJXpsKIuIcC4bY=; b=O64bnKH6KoKyvWVSyqsE/LKur6GdHTj0Y+7e5nyW8QRvasi2/E6oSdzxy+t0qnj4Xp COFS13bw8Nc/5nXiOjUWGNciFr7Q24v659AECXVa89pDdoG9I8sczFxW9ExlVQFTBEkh 8BTS2GwYBT99RYUJSupN7so85Jx0cN11OqU1+Onri0yO/GrB8HFzSzDOa2szyKasKyl4 HPKDu2XGcsUOMdBC9zGj1AhuHThAOyduETNOD93ZscYsX9MuzfhQ9VQNVxRCgEH/5IwE DIvJV2AXKyRhrRj3W6kw/1LE2dzsvDONt+mkKGh9NLuHB/cQeRodbeEv9LkTFzT1NRMq c/Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:to:cc:subject:from:references:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=XOrLreEsAuVDxgUxU0x2eSWaOLostnJXpsKIuIcC4bY=; b=k7g760b6qft5jj68SEtT4ZcwD8g2iGjX95X1zeHtcsJqRQDPnf+0kwhrikDfJDedAO u60pDEc4bxqmYijtu2iazhE+UkIuEFr6WEpuHjl8j0iCJ/rZZ3gJS2dQEnnib3tCmYmz k6f3ilmIGN6Ic4l0s4lngeDK42O/oJ3jMCuIeJIB9T3CxKHdQ2X0sTRRA/q99qhqrqTI pNsUJJyfUnEhOhr56bI1jCXCBDvz4+YGAYp+MWcPXmZ3Osh/D6uazjiKSLyjEvg3b1tk 4jLPKtGMwB+8T4WqT/kQm418JQEbnXQA5L3GlGiDraa1W2/1sT79bOt9xKl/cYMKwKux ZJAA== X-Gm-Message-State: AOAM532rRInjyII1u2/lW24B1DGsmxmeWD+VNMzvhP6DHcqkoPtl5Wcm Oyd7jkJFvBs6N2vjHYn02oIkPqmLMzteLdlS6tpz+Q== X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr86949pjq.74.1633542558298; Wed, 06 Oct 2021 10:49:18 -0700 (PDT) Received: from localhost ([98.45.152.168]) by smtp.gmail.com with ESMTPSA id z10sm20718583pfn.70.2021.10.06.10.49.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Oct 2021 10:49:18 -0700 (PDT) Date: Wed, 06 Oct 2021 10:49:17 -0700 To: Arnd Bergmann Cc: alsa-devel@alsa-project.org, Takashi Iwai , Baolin Wang , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Mark Brown , Baolin Wang Subject: Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control From: Michael Forney References: <20191211212025.1981822-1-arnd@arndb.de> <20191211212025.1981822-9-arnd@arndb.de> In-Reply-To: <20191211212025.1981822-9-arnd@arndb.de> Message-Id: <29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann wrote: > +#if defined(__BYTE_ORDER) ? __BYTE_ORDER =3D=3D __BIG_ENDIAN : defined(_= _BIG_ENDIAN) > +typedef char __pad_before_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_= t)]; > +typedef char __pad_after_uframe[0]; > +#endif > + > +#if defined(__BYTE_ORDER) ? __BYTE_ORDER =3D=3D __LITTLE_ENDIAN : define= d(__LITTLE_ENDIAN) > +typedef char __pad_before_uframe[0]; > +typedef char __pad_after_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t= )]; > +#endif > + > +struct __snd_pcm_mmap_status64 { > + __s32 state; /* RO: state - SNDRV_PCM_STATE_XXXX */ > + __u32 pad1; /* Needed for 64 bit alignment */ > + __pad_before_uframe __pad1; > + snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ > + __pad_after_uframe __pad2; > + struct __snd_timespec64 tstamp; /* Timestamp */ > + __s32 suspended_state; /* RO: suspended stream state */ > + __u32 pad3; /* Needed for 64 bit alignment */ > + struct __snd_timespec64 audio_tstamp; /* sample counter or wall clock *= / > +}; > + > +struct __snd_pcm_mmap_control64 { > + __pad_before_uframe __pad1; > + snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ > + __pad_before_uframe __pad2; I was looking through this header and happened to notice that this padding is wrong. I believe it should be __pad_after_uframe here. I'm not sure of the implications of this typo, but I suspect it breaks something on 32-bit systems with 64-bit time (regardless of the endianness, since it changes the offset of avail_min). > + > + __pad_before_uframe __pad3; > + snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup *= / > + __pad_after_uframe __pad4; > +};