Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512AbZKLVAO (ORCPT ); Thu, 12 Nov 2009 16:00:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754445AbZKLVAL (ORCPT ); Thu, 12 Nov 2009 16:00:11 -0500 Received: from mail-iw0-f178.google.com ([209.85.223.178]:52401 "EHLO mail-iw0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754415AbZKLVAJ (ORCPT ); Thu, 12 Nov 2009 16:00:09 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=jbE443p5p+ycuGShSUaO3ZwoxDe7MczPwPY4sci09Ht4TIyeV8sb93hu+qxsXDjDwb 5aUViIztgEz44ZPXJCgnc7TNGuNngCPWZvOOGWllUjPOakby0xHTf8XTyoA+jNMBXJ3g OAxJnKhPpkz1ImdGuJw9/RgsiHa6/emCvUOiQ= MIME-Version: 1.0 In-Reply-To: <1258059180-4353-1-git-send-email-felipe.contreras@gmail.com> References: <1258059180-4353-1-git-send-email-felipe.contreras@gmail.com> Date: Thu, 12 Nov 2009 23:00:14 +0200 Message-ID: <94a0d4530911121300p633e5163xfa15b7434a074022@mail.gmail.com> Subject: Re: [PATCH v3] omap3-iommu: reorganize From: Felipe Contreras To: linux-kernel@vger.kernel.org Cc: Tony Lindgren , Hiroshi Doyu , Hari Kanigeri , Felipe Contreras Content-Type: multipart/mixed; boundary=0016e64603ea7473a0047832d4fb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8470 Lines: 131 --0016e64603ea7473a0047832d4fb Content-Type: text/plain; charset=UTF-8 On Thu, Nov 12, 2009 at 10:52 PM, Felipe Contreras wrote: > This is the third version of my attempt to reorganize the omap3 iommu code to > make it easier to read and more extensible. I've taken into consideration > Russell and Hiroshi's comments. Also, rebased on top of Tony's 'for-next' > branch, although no changes have been done since v2. > > I'm resending because Tony asked me to. Last comments from Hiroshi were not so positive, so I'm attaching a dummy omap4-iommu.c with 4 devices in order to show that the new format is actually more extensible (the 2 formats are shown). Cheers. -- Felipe Contreras --0016e64603ea7473a0047832d4fb Content-Type: text/x-csrc; charset=US-ASCII; name="omap4-iommu-1.c" Content-Disposition: attachment; filename="omap4-iommu-1.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1y065wa0 LyoKICogb21hcCBpb21tdTogb21hcDQgZGV2aWNlIHJlZ2lzdHJhdGlvbgogKgogKiBDb3B5cmln aHQgKEMpIDIwMDgtMjAwOSBOb2tpYSBDb3Jwb3JhdGlvbgogKgogKiBXcml0dGVuIGJ5IEhhcmkg S2FuaWdlcmkgPGgta2FuaWdlcmkyQHRpLmNvbT4KICoKICogQWRkZWQgc3VwcG9ydCBmb3IgT01B UDQuIFRoaXMgaXMgYmFzZWQgb24gb3JpZ2luYWwgZmlsZQogKiBvbWFwMy1pb21tdS5jCiAqCiAq IFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBh bmQvb3IgbW9kaWZ5CiAqIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVi bGljIExpY2Vuc2UgdmVyc2lvbiAyIGFzCiAqIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2Fy ZSBGb3VuZGF0aW9uLgogKi8KCiNpbmNsdWRlIDxsaW51eC9wbGF0Zm9ybV9kZXZpY2UuaD4KCiNp bmNsdWRlIDxtYWNoL2lvbW11Lmg+CiNpbmNsdWRlIDxtYWNoL2lycXMuaD4KCiNkZWZpbmUgT01B UDRfTU1VMV9CQVNFCTB4NTUwODIwMDAKI2RlZmluZSBPTUFQNF9NTVUyX0JBU0UJMHg0QTA2NjAw MAojZGVmaW5lIE9NQVA0X01NVTNfQkFTRQkweDAwMD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pZiAoZXJyKQoJCQlnb3RvIGVy cl9vdXQ7CgkJb21hcDRfaW9tbXVfcGRldltpXSA9IHBkZXY7Cgl9CglyZXR1cm4gMDsKCmVycl9v dXQ6Cgl3aGlsZSAoaS0tKQoJCXBsYXRmb3JtX2RldmljZV9wdXQob21hcDRfaW9tbXVfcGRldltp XSk7CglyZXR1cm4gZXJyOwp9Cm1vZHVsZV9pbml0KG9tYXA0X2lvbW11X2luaXQpOwoKc3RhdGlj IHZvaWQgX19leGl0IG9tYXA0X2lvbW11X2V4aXQodm9pZCkKewoJaW50IGk7CgoJZm9yIChpID0g MDsgaSA8IE5SX0lPTU1VX0RFVklDRVM7IGkrKykKCQlwbGF0Zm9ybV9kZXZpY2VfdW5yZWdpc3Rl cihvbWFwNF9pb21tdV9wZGV2W2ldKTsKfQptb2R1bGVfZXhpdChvbWFwNF9pb21tdV9leGl0KTsK Ck1PRFVMRV9BVVRIT1IoIkhpcm9zaGkgRE9ZVSwgSGFyaSBLYW5pZ2VyaSIpOwpNT0RVTEVfREVT Q1JJUFRJT04oIm9tYXAgaW9tbXU6IG9tYXA0IGRldmljZSByZWdpc3RyYXRpb24iKTsKTU9EVUxF X0xJQ0VOU0UoIkdQTCB2MiIpOwo= --0016e64603ea7473a0047832d4fb Content-Type: text/x-csrc; charset=US-ASCII; name="omap4-iommu-2.c" Content-Disposition: attachment; filename="omap4-iommu-2.c" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1y06hjo1 LyoKICogb21hcCBpb21tdTogb21hcDQgZGV2aWNlIHJlZ2lzdHJhdGlvbgogKgogKiBDb3B5cmln aHQgKEMpIDIwMDgtMjAwOSBOb2tpYSBDb3Jwb3JhdGlvbgogKgogKiBXcml0dGVuIGJ5IEhhcmkg S2FuaWdlcmkgPGgta2FuaWdlcmkyQHRpLmNvbT4KICoKICogQWRkZWQgc3VwcG9ydCBmb3IgT01B UDQuIFRoaXMgaXMgYmFzZWQgb24gb3JpZ2luYWwgZmlsZQogKiBvbWFw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RldiwgcmVzLAoJCQkJCQkgICAgQVJSQVlfU0la RShyZXMpKTsKCQlpZiAoZXJyKQoJCQlnb3RvIGVycl9vdXQ7CgkJZXJyID0gcGxhdGZvcm1fZGV2 aWNlX2FkZF9kYXRhKHBkZXYsICZkLT5wZGF0YSwKCQkJCQkgICAgICAgc2l6ZW9mKGQtPnBkYXRh KSk7CgkJaWYgKGVycikKCQkJZ290byBlcnJfb3V0OwoJCWVyciA9IHBsYXRmb3JtX2RldmljZV9h ZGQocGRldik7CgkJaWYgKGVycikKCQkJZ290byBlcnJfb3V0OwoJCW9tYXA0X2lvbW11X3BkZXZb aV0gPSBwZGV2OwoJfQoJcmV0dXJuIDA7CgplcnJfb3V0OgoJd2hpbGUgKGktLSkKCQlwbGF0Zm9y bV9kZXZpY2VfcHV0KG9tYXA0X2lvbW11X3BkZXZbaV0pOwoJcmV0dXJuIGVycjsKfQptb2R1bGVf aW5pdChvbWFwNF9pb21tdV9pbml0KTsKCnN0YXRpYyB2b2lkIF9fZXhpdCBvbWFwNF9pb21tdV9l eGl0KHZvaWQpCnsKCWludCBpOwoKCWZvciAoaSA9IDA7IGkgPCBOUl9JT01NVV9ERVZJQ0VTOyBp KyspCgkJcGxhdGZvcm1fZGV2aWNlX3VucmVnaXN0ZXIob21hcDRfaW9tbXVfcGRldltpXSk7Cn0K bW9kdWxlX2V4aXQob21hcDRfaW9tbXVfZXhpdCk7CgpNT0RVTEVfQVVUSE9SKCJIaXJvc2hpIERP WVUsIEhhcmkgS2FuaWdlcmkiKTsKTU9EVUxFX0RFU0NSSVBUSU9OKCJvbWFwIGlvbW11OiBvbWFw NCBkZXZpY2UgcmVnaXN0cmF0aW9uIik7Ck1PRFVMRV9MSUNFTlNFKCJHUEwgdjIiKTsK --0016e64603ea7473a0047832d4fb-- -- 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/