From owner-freebsd-embedded@FreeBSD.ORG Wed Nov 6 21:56:55 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBB594BB for ; Wed, 6 Nov 2013 21:56:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B09F21C8 for ; Wed, 6 Nov 2013 21:56:55 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id ar20so231701iec.12 for ; Wed, 06 Nov 2013 13:56:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=6aVBfmz26GQWktt49He+Si+xeQLQR6wopKMjp+VSmoY=; b=L/jNfn40Me8xD4e7vRpmAZj7QanlyM5SavKfgiXmGL6RMe3IUqgseQnKV1P61O7Ay1 AQsq/T+9dX24ELgjjrk7ct3HQsYUvz1WHrOyuTJoUXrKk4trLTXjY3H07RZ61xnY7fT8 eLbR2416XGOEuC+1ocplDp+QomyvAUYrPnG1VDcAYy+eSCHUUvaZoufmoPPzon82mgQn bXIh5D9yYpLBMmCme1iV45v3fIZ2cq5j6C7kcUwbgad9+uqylKggyV22yEl7Z7BwsmjL iozys3GSh3i2A8yewMfUsoaW5JLykfTVtjgIoZgu61bqWG3fI/IhDP6rlABeVq2AvhLK O5RA== X-Gm-Message-State: ALoCoQme/d0d+xpd3JbzsT1Yv6C9iamXP48dsDXGTBE88iklS+xYFv/jG6PfgxD/g53mVjs92Mjv X-Received: by 10.50.45.73 with SMTP id k9mr22003636igm.38.1383775009383; Wed, 06 Nov 2013 13:56:49 -0800 (PST) Received: from fusionlt2834a.int.fusionio.com ([209.119.30.70]) by mx.google.com with ESMTPSA id x6sm16287698igb.3.2013.11.06.13.56.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 13:56:48 -0800 (PST) Sender: Warner Losh Subject: Re: Incorrect struct onfi_params definition Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20131106212855.GF58987@vega.codepro.be> Date: Wed, 6 Nov 2013 13:56:46 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <20131106212855.GF58987@vega.codepro.be> To: Kristof Provost X-Mailer: Apple Mail (2.1085) Cc: Grzegorz Bernacki , freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2013 21:56:55 -0000 On Nov 6, 2013, at 1:28 PM, Kristof Provost wrote: > Hi, > > The definition of struct onfi_params in sys/dev/nand/nand.h is > incorrect. The total structure size should be 256 bytes, but it's only > 176 bytes. > > That's because the vendor_spec array was declared as being 8 bytes, > rather than the 88 bytes it should be. Clearly a typo. > > This patch should fix it: > > diff --git a/sys/dev/nand/nand.h b/sys/dev/nand/nand.h > index 0d6d7b4..46b6993 100644 > --- a/sys/dev/nand/nand.h > +++ b/sys/dev/nand/nand.h > @@ -217,7 +217,7 @@ struct onfi_params { > uint8_t driver_strength_support; > uint8_t res4[12]; > uint16_t vendor_rev; > - uint8_t vendor_spec[8]; > + uint8_t vendor_spec[88]; > uint16_t crc; > }__attribute__((packed)); > I'd add a CT_ASSERT sizeof(onfi_params) == 256 too. Warner > Regards, > Kristof > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org"