From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941219AbcIYXzq (ORCPT ); Sun, 25 Sep 2016 19:55:46 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:53726 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756616AbcIYXzo (ORCPT ); Sun, 25 Sep 2016 19:55:44 -0400 Date: Sun, 25 Sep 2016 16:55:42 -0700 From: Christoph Hellwig To: Ondrej Zary Cc: Christoph Hellwig , Finn Thain , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/3] g_NCR5380: Merge g_NCR5380 and g_NCR5380_mmio Message-ID: <20160925235542.GD7312@infradead.org> References: <1474743545-4731-1-git-send-email-linux@rainbow-software.org> <1474832360-23261-1-git-send-email-linux@rainbow-software.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474832360-23261-1-git-send-email-linux@rainbow-software.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 25, 2016 at 09:39:20PM +0200, Ondrej Zary wrote: > Merge the PIO and MMIO code (with the help of ioport_map) in g_NCR5380 and > delete g_NCR5380_mmio. Awesome! this looks great to me, but we probably should thrown in a MODULE_ALIAS for g_NCR5380_mmio so that existing module configurations keep working. > #define NCR5380_read(reg) \ > + ioread8(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ > + ((struct NCR5380_hostdata *)shost_priv(instance))->offset + \ > + (reg)) > #define NCR5380_write(reg, value) \ > - outb(value, instance->io_port + (reg)) > + iowrite8(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ > + ((struct NCR5380_hostdata *)shost_priv(instance))->offset + \ > + (reg)) Can we make these #defines point to inline helper functions that avoid the casting magic, e.g. something like static inline void g_NCR5380_write(struct Scsi_Host *instance, u32 reg, u8 value) { struct NCR5380_hostdata *host = shost_priv(instance); iowrite8(value, host->iomem, host->offset + reg); } #define NCR5380_write(reg, value) g_NCR5380_write(instance, reg, value)