From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14146C10F0E for ; Fri, 12 Apr 2019 11:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5F6920643 for ; Fri, 12 Apr 2019 11:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727190AbfDLLQy (ORCPT ); Fri, 12 Apr 2019 07:16:54 -0400 Received: from 8bytes.org ([81.169.241.247]:34386 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbfDLLQx (ORCPT ); Fri, 12 Apr 2019 07:16:53 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 5249D21D; Fri, 12 Apr 2019 13:16:51 +0200 (CEST) Date: Fri, 12 Apr 2019 13:16:50 +0200 From: Joerg Roedel To: Zhen Lei Cc: Jean-Philippe Brucker , John Garry , Robin Murphy , Will Deacon , Jonathan Corbet , linux-doc , Sebastian Ott , Gerald Schaefer , Martin Schwidefsky , Heiko Carstens , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Tony Luck , Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , David Woodhouse , iommu , linux-kernel , linux-s390 , linuxppc-dev , x86 , linux-ia64 , Hanjun Guo Subject: Re: [PATCH v5 1/6] iommu: add generic boot option iommu.dma_mode Message-ID: <20190412111649.GK4518@8bytes.org> References: <20190409125308.18304-1-thunder.leizhen@huawei.com> <20190409125308.18304-2-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190409125308.18304-2-thunder.leizhen@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 08:53:03PM +0800, Zhen Lei wrote: > +static int __init iommu_dma_mode_setup(char *str) > +{ > + if (!str) > + goto fail; > + > + if (!strncmp(str, "passthrough", 11)) > + iommu_default_dma_mode = IOMMU_DMA_MODE_PASSTHROUGH; > + else if (!strncmp(str, "lazy", 4)) > + iommu_default_dma_mode = IOMMU_DMA_MODE_LAZY; > + else if (!strncmp(str, "strict", 6)) > + iommu_default_dma_mode = IOMMU_DMA_MODE_STRICT; > + else > + goto fail; > + > + pr_info("Force dma mode to be %d\n", iommu_default_dma_mode); Printing a number is not very desriptive or helpful to the user. Please print the name of the mode instead. Regards, Joerg