From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbdF1KU7 (ORCPT ); Wed, 28 Jun 2017 06:20:59 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:34391 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbdF1KUx (ORCPT ); Wed, 28 Jun 2017 06:20:53 -0400 MIME-Version: 1.0 In-Reply-To: <20170627230204.16410-4-logang@deltatee.com> References: <20170627230204.16410-1-logang@deltatee.com> <20170627230204.16410-4-logang@deltatee.com> From: Arnd Bergmann Date: Wed, 28 Jun 2017 12:20:51 +0200 X-Google-Sender-Auth: RozxviDkXRCSL7LK7e2l8sP-Rvk Message-ID: Subject: Re: [PATCH v2 3/3] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 To: Logan Gunthorpe Cc: Linux Kernel Mailing List , linux-arch , linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Jyri Sarha , Stephen Bates , =?UTF-8?Q?Horia_Geant=C4=83?= , Dan Douglass , Herbert Xu , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2017 at 1:02 AM, Logan Gunthorpe wrote: > #include > #include > -#include > +#include Here you include the hi-lo variant unconditionally. > -#else /* CONFIG_64BIT */ > -static inline void wr_reg64(void __iomem *reg, u64 data) > -{ > -#ifndef CONFIG_CRYPTO_DEV_FSL_CAAM_IMX > - if (caam_little_end) { > - wr_reg32((u32 __iomem *)(reg) + 1, data >> 32); > - wr_reg32((u32 __iomem *)(reg), data); > - } else > #endif > - { > - wr_reg32((u32 __iomem *)(reg), data >> 32); > - wr_reg32((u32 __iomem *)(reg) + 1, data); > - } > + iowrite64be(data, reg); > } However, the #else path here uses lo-hi instead. I guess we have to decide how to define iowrite64be_lo_hi() first: it could either byteswap the 64-bit value first, then write the two halves, or it could write the two halves, doing a 32-bit byte swap on each. Arnd