From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4311EC07E96 for ; Tue, 13 Jul 2021 11:23:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05BFB611C0 for ; Tue, 13 Jul 2021 11:23:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05BFB611C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ojvYPzImd8e9Pb/+F58bY8gZ+YeuqVxkpm2ergIuSmE=; b=1pbaYQMoBzme8K FhRdPfzm8vVUeZ8p7plbaGZjeCyhrRSSiWXZgVA+KKS5p9al49FoaPOOL5kUL/iF2oDLX5zxgtszv 3f3nBnKL5FwQaTeybWXE/KgdRYcUF1/a1ah3hkbbj5BaskbDb6xZVZMYS+9fJaa67rricfvHOjAT1 6WXVQiJoYndc0Ag93Iti2RfwdNuWq4AN+zmpn+l4HBJiuDEqksWjeA2dTdHJ1eXSgRRQKPG7vqVnv y4nzmb9HbqWfJRqFQdgJwVXzaW+owKGkd8IbSoAF+gzH8eeYE7PrZbB6Vfo3x+8yxd3EM6ramqiSF 8DyuMoufOpM6ucOMA64Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3GTt-00A9ak-FN; Tue, 13 Jul 2021 11:21:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3GGf-00A5gQ-1I for linux-arm-kernel@bombadil.infradead.org; Tue, 13 Jul 2021 11:08:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=Bo7Zj6cBVukoQrHTJUN7uUax553ZALe2kY4JflTKANA=; b=Xz8Svexr+aBoi8oI5arPWENQ1p Y7FD5Kjo6frg/VYwTsOe+PJwel5HIjxU6FdPBS9jF427t7V3GUXc2aePESEHvhbV8U3xPSZJ+ZxrU OJRYQwMCbrDvmzObdaohESxBICA1Ux0UOAPpAr98OytFVYfMdrHfxrSGL7D2NY/DbXJQ/63dWTb3+ 6oKsExafqtrZvCOmSa0NDAjHE8aHeI7naaglOrfQpLA9vxwilpasEpkj8S2a6x1wKCzNxvhU6MjXp IcJgHfKCMYHTs8goxNpDS5vZHvRDn5Q+OTo3yS38Fyx2lAGFrGNzx5MU2YvGajntM9TlCMYdPcKOO BHDAN+4Q==; Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3GFz-00117o-3C for linux-arm-kernel@lists.infradead.org; Tue, 13 Jul 2021 11:07:45 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-149-IVa75z0JOaOBrGaXpniqdQ-1; Tue, 13 Jul 2021 12:07:03 +0100 X-MC-Unique: IVa75z0JOaOBrGaXpniqdQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 13 Jul 2021 12:07:01 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.018; Tue, 13 Jul 2021 12:07:01 +0100 From: David Laight To: 'Russell King' , =?iso-8859-1?Q?Uwe_Kleine-K=F6nig?= CC: Salah Triki , "fabrice.gasnier@foss.st.com" , "thierry.reding@gmail.com" , "lee.jones@linaro.org" , "mcoquelin.stm32@gmail.com" , "alexandre.torgue@foss.st.com" , "linux-pwm@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] divide by 3*sizeof(u32) when computing array_size Thread-Topic: [PATCH] divide by 3*sizeof(u32) when computing array_size Thread-Index: AQHXd8hGdzQpdmgYHUiEx+VC3p1WwKtAvfwg Date: Tue, 13 Jul 2021 11:07:00 +0000 Message-ID: <012ccfea2a564274bd9d2e1cfc130873@AcuMS.aculab.com> References: <20210712231910.GA1831270@pc> <20210713063053.qqttzxlopvpnadj3@pengutronix.de> <20210713091954.GG22278@shell.armlinux.org.uk> In-Reply-To: <20210713091954.GG22278@shell.armlinux.org.uk> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210713_120732_275155_93AA2FD4 X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Russell King > Sent: 13 July 2021 10:20 .... > I would also note that the code relies on there being no padding in > struct stm32_breakinput - it should be noted that a strict > interpretation of the C standard allows padding to be added anywhere > to a structure - at the start, end or between members. I'm pretty certain I remember that padding before the first member isn't allowed. In any case the kernel generally assumes there is no extra padding. (eg for structures that map hardware registers.) For big structures it is worth adding a compile-time check of the structure size - but not really for three u32. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel