From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH 4/5] mtd: spi-nor: Add driver for Adaptrum Anarion QSPI controller To: Marek Vasut , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org References: <20170728220707.13960-1-alex.g@adaptrum.com> <20170728220707.13960-5-alex.g@adaptrum.com> <135fdf95-1029-2d34-2802-1283a73588e5@gmail.com> <83a4e27a-b96c-0558-fbb5-10e64f9bf59b@adaptrum.com> <1da97744-bc02-420e-d4e9-5ebf331475e8@gmail.com> Cc: David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger , Cyrille Pitchen , Rob Herring , Mark Rutland , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org From: Alexandru Gagniuc Message-ID: <054534f2-deed-a339-f82a-e3eba569b029@adaptrum.com> Date: Mon, 31 Jul 2017 15:59:17 -0700 MIME-Version: 1.0 In-Reply-To: <1da97744-bc02-420e-d4e9-5ebf331475e8@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 07/31/2017 03:43 PM, Marek Vasut wrote: > On 08/01/2017 12:20 AM, Alexandru Gagniuc wrote: >> On 07/31/2017 02:33 PM, Marek Vasut wrote: >>> On 07/31/2017 07:17 PM, Alexandru Gagniuc wrote: >>>>>> +struct anarion_qspi { >>>>>> + struct spi_nor nor; >>>>>> + struct device *dev; >>>>>> + uintptr_t regbase; >>>>> >>>>> Should be void __iomem * I guess ? >>>> >>>> I chose uintptr_t as opposed to void *, because arithmetic on void * is >>>> not valid in C. What is the right answer hen, without risking undefined >>>> behavior? >>> >>> What sort of arithmetic ? It's perfectly valid in general ... >> >> ISO/IEC 9899:201x, Section 6.5.6, constraint(2) is not met when the one >> of the operands to addition is a void pointer. >> Section 6.2.5 (19) defines void to be an incomplete type. > > Is that something new in C 201x draft ? C99 had similar restrictions. > Anyway, this would mean half of the drivers are broken, so I'm not convinced. They are. Feel free to send me a private email if you want to discuss this further. Alex