Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753008AbbBPFgB (ORCPT ); Mon, 16 Feb 2015 00:36:01 -0500 Received: from ozlabs.org ([103.22.144.67]:42184 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbbBPFgA convert rfc822-to-8bit (ORCPT ); Mon, 16 Feb 2015 00:36:00 -0500 From: Rusty Russell To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Subject: Re: [PATCH 1/2] virtio_pci_modern: type-safe io accessors In-Reply-To: <87vbj28qco.fsf@rustcorp.com.au> References: <1423977123-10115-1-git-send-email-mst@redhat.com> <87vbj28qco.fsf@rustcorp.com.au> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Mon, 16 Feb 2015 15:01:24 +1030 Message-ID: <87r3tq8okj.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 882 Lines: 29 Rusty Russell writes: > "Michael S. Tsirkin" writes: >> The spec is very clear on this: >> >> 4.1.3.1 Driver Requirements: PCI Device Layout >> >> The driver MUST access each field using the “natural” access method, >> i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit >> fields and 8-bit accesses for 8-bit fields. >> >> Add type-safe wrappers to prevent access with incorrect width. > > Applied both (for *next* merge window). ... and fixed this: >> +static inline void vp_iowrite32(u32 value, u32 __iomem *addr) >> +{ >> + iowrite16(value, addr); >> +} Thanks, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/