Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061AbbLOPsp (ORCPT ); Tue, 15 Dec 2015 10:48:45 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:32817 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753862AbbLOPsn (ORCPT ); Tue, 15 Dec 2015 10:48:43 -0500 MIME-Version: 1.0 In-Reply-To: <20151215120239.26216.43390.sendpatchset@little-apple> References: <20151215120212.26216.61530.sendpatchset@little-apple> <20151215120239.26216.43390.sendpatchset@little-apple> Date: Tue, 15 Dec 2015 16:48:42 +0100 X-Google-Sender-Auth: Nin28RJpc2TrVSRfRThXGd7Yric Message-ID: Subject: Re: [PATCH 03/06] iommu/ipmmu-vmsa: Break out utlb control function From: Geert Uytterhoeven To: Magnus Damm Cc: iommu@lists.linux-foundation.org, Laurent Pinchart , Geert Uytterhoeven , Linux-sh list , Joerg Roedel , "linux-kernel@vger.kernel.org" , Simon Horman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1700 Lines: 43 Hi Magnus, On Tue, Dec 15, 2015 at 1:02 PM, Magnus Damm wrote: > --- 0004/drivers/iommu/ipmmu-vmsa.c > +++ work/drivers/iommu/ipmmu-vmsa.c 2015-12-15 13:17:40.580513000 +0900 > @@ -279,9 +279,18 @@ static void ipmmu_utlb_enable(struct ipm > static void ipmmu_utlb_disable(struct ipmmu_vmsa_domain *domain, > unsigned int utlb) > { > - struct ipmmu_vmsa_device *mmu = domain->mmu; > + ipmmu_write(domain->mmu, IMUCTR(utlb), 0); > +} > + > +static void ipmmu_utlb_ctrl(struct ipmmu_vmsa_domain *domain, > + void (*fn)(struct ipmmu_vmsa_domain *, > + unsigned int utlb), struct device *dev) > +{ > + struct ipmmu_vmsa_dev_data *dev_data = get_dev_data(dev); > + unsigned int i; > > - ipmmu_write(mmu, IMUCTR(utlb), 0); > + for (i = 0; i < dev_data->num_utlbs; ++i) > + fn(domain, dev_data->utlbs[i]); > } Unless you have further plans with the "fn" parameter, I would simply pass a bool enable/disable flag instead of a function pointer. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- 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/