Thread (19 messages) 19 messages, 3 authors, 2017-01-19

Re: [PATCH v3 4/4] can: peak: add support for PEAK PCAN-PCIe FD CAN-FD boards

From: Stephane Grosjean <hidden>
Date: 2017-01-19 13:04:07

Hello Marc,

Building my code onto a 32-bits machine:

Le 13/01/2017 à 12:38, Marc Kleine-Budde a écrit :
On 01/11/2017 01:16 PM, Stephane Grosjean wrote:
quoted
  - every "#ifdef CONFIG_xxx" has been changed into "IS_ENABLED(CONFIG_xxx)"
This change leads to the following code, as you suggested:

                 lk->laddr_lo = cpu_to_le32(page->lbase);

                 if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))
                         lk->laddr_hi = cpu_to_le32(page->lbase >> 32);
                 else
                         lk->laddr_hi = 0;

*WITH*

struct pciefd_page {
         dma_addr_t lbase;               /* page logical address */
};

*BUT* building this code when CONFIG_ARCH_DMA_ADDR_T_64BIT is not 
defined (neither Y nor M), that is, on a 32-bits machine I suppose, 
generates the following warning:

drivers/net/can/peak_canfd/peak_pciefd_main.c:532:43: warning: right 
shift count >= width of type [-Wshift-count-overflow]
     lk->laddr_hi = cpu_to_le32(page->lbase >> 32);

which is obviously true, since "dma_addr_t" is here a 32-bits width type.

So, in that case, I don't see any other way to fix, than using the (old) 
#ifdef CONFIG_xxx style, present in v2.

Your opinion, please?

Stéphane.
--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt - HRB 9183 
Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help