Thread (5 messages) 5 messages, 4 authors, 2016-02-08

Re: [PATCH v7] SATA: OCTEON: support SATA on OCTEON platform

From: Zubair Lutfullah Kakakhel <hidden>
Date: 2016-02-04 16:06:04
Also in: linux-ide, lkml

Hi,

Thank-you for the review.

On 04/02/16 12:24, Aleksey Makarov wrote:
Hi Zubair,
quoted
+	void __iomem *base;
[..]
quoted
+	cfg = cvmx_read_csr((uint64_t)base + CVMX_SATA_UCTL_SHIM_CFG);
sparse will complain here.  See Documentation/sparse.txt
Yes. sparse says

...
CHECK   drivers/ata/sata_octeon.c
drivers/ata/sata_octeon.c:50:30: warning: cast removes address space of expression
drivers/ata/sata_octeon.c:65:25: warning: cast removes address space of expression
...

Use of (__force uint64_t) removes the sparse warning. But it was
frowned upon by arnd.

He suggested a wrapper helper in asm/octeon/cvmx.h which handles iomem
addresses and __force behind the scenes rather than in the driver.

static inline void cvmx_write_csr_resource(void __iomem *csr_addr, uint64_t val)
{
	cvmx_write_csr((__force uint64_t)csr_addr, val)
}

Alternatives? Or should I resend with the above wrapper?

Regards,
ZubairLK
Thank you
Aleksey Makarov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help