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=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 2629EC433E0 for ; Wed, 1 Jul 2020 13:30:42 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7F7F20702 for ; Wed, 1 Jul 2020 13:30:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A1rO08Qk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7F7F20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49xhtj5cF2zDr3f for ; Wed, 1 Jul 2020 23:30:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f43; helo=mail-qv1-xf43.google.com; envelope-from=leobras.c@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=A1rO08Qk; dkim-atps=neutral Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49xhqx2LLwzDqxs for ; Wed, 1 Jul 2020 23:28:12 +1000 (AEST) Received: by mail-qv1-xf43.google.com with SMTP id m9so10970314qvx.5 for ; Wed, 01 Jul 2020 06:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:user-agent:mime-version:content-transfer-encoding; bh=Y/vZ0IaH6Uw3eP/ISe3M+HbULBx3TPd+u4JIT5Z3fII=; b=A1rO08QkgPZhsED3RVZ+ZqDVen4OR0gzB2qMM0S8Kku4IJn6vBsKt27YiE4kHW8KFm p1KAW+mE+L/3x6XxIJFQJfFntNSqKuY6n+rDDL0P061Q7FuOVf/BRnHYUCr/uVVPHtx6 vFQWI4Wv5ktyjLp/PCN69/7jC7WDYdaSbd0AFkuYcmiO/iIHHxaiQttsc6v3cczcywhM Duze3SKjWqbuT/HdoyFmH5vRByF1YRHXen4RvRzwnmLbn7tR6w73wdZQ8UrPHDZoF/C/ LKtAQkekuwjXHp6AdqoGNTI09FGVRWq24j8IaK16749iCejHcuArxfqcvUZDqjYDPTl9 fiuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=Y/vZ0IaH6Uw3eP/ISe3M+HbULBx3TPd+u4JIT5Z3fII=; b=JqV1DoXsoJ5PPC5VjpFcKsdfXfPNogXHy4AELf1vkCQvzeGnl80+Ad7ZDNHryj8rZb +lC+KERyCJBQOxRVkrW2+Bdx9K5RixwZUg7LskCceHPeOnCTVrSV4NSgDeyGspxPLAKP ch8uHJbYN1GDfePzekP2EFPTD3+9+9pl4K31krbuxO/yPYbVDr/tiPVhudPXUqLA83ED Ehk2v4AZct7Ejr7UqaNyWz/HvkX9FZPjndwI846ylQI67vw62tDowNNUJDatfrF7Sm5p lAKHuaVxJsOrk9LUhVTXeTkYTVq8IseAQ7rrM4vShsIeAzA9rAGAYP894cGG0bfJXcCe 0STg== X-Gm-Message-State: AOAM531IZYDkCfzqcshqgS/UMAfl4XXd0vmEr1TBT0I+LNyl7JGO7U0z 52aBdXvnqNlW1YgBI9INBkg= X-Google-Smtp-Source: ABdhPJw3huwWuQG/EdrGuTHYYm3gTieFnFjw1EBMeRiZdWUlp7fgVj5eowMXqInAwJJRpPTtZncaZA== X-Received: by 2002:a0c:99e1:: with SMTP id y33mr22349026qve.90.1593610089419; Wed, 01 Jul 2020 06:28:09 -0700 (PDT) Received: from LeoBras (200-236-245-17.dynamic.desktop.com.br. [200.236.245.17]) by smtp.gmail.com with ESMTPSA id i8sm5333510qtr.90.2020.07.01.06.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 06:28:08 -0700 (PDT) Message-ID: <01443a2f1d58a595ddff03fd14fd56f4c26171bf.camel@gmail.com> Subject: Re: [PATCH v2 1/6] powerpc/pseries/iommu: Create defines for operations in ibm,ddw-applicable From: Leonardo Bras To: Alexey Kardashevskiy , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Thiago Jung Bauermann , Ram Pai Date: Wed, 01 Jul 2020 10:28:03 -0300 In-Reply-To: References: <20200624062411.367796-1-leobras.c@gmail.com> <20200624062411.367796-2-leobras.c@gmail.com> Organization: IBM Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 2020-07-01 at 18:16 +1000, Alexey Kardashevskiy wrote: > > On 24/06/2020 16:24, Leonardo Bras wrote: > > Create defines to help handling ibm,ddw-applicable values, avoiding > > confusion about the index of given operations. > > > > Signed-off-by: Leonardo Bras > > --- > > arch/powerpc/platforms/pseries/iommu.c | 40 +++++++++++++++----------- > > 1 file changed, 23 insertions(+), 17 deletions(-) > > > > diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c > > index 6d47b4a3ce39..68d2aa9c71a8 100644 > > --- a/arch/powerpc/platforms/pseries/iommu.c > > +++ b/arch/powerpc/platforms/pseries/iommu.c > > @@ -39,6 +39,11 @@ > > > > #include "pseries.h" > > > > +#define DDW_QUERY_PE_DMA_WIN 0 > > +#define DDW_CREATE_PE_DMA_WIN 1 > > +#define DDW_REMOVE_PE_DMA_WIN 2 > > +#define DDW_APPLICABLE_SIZE 3 > > #define DDW_APPLICABLE_SIZE (DDW_REMOVE_PE_DMA_WIN + 1) > > thanks, Thanks for the feedback! About this (and patch #2), would it be better to use enum ? enum { DDW_QUERY_PE_DMA_WIN, DDW_CREATE_PE_DMA_WIN, DDW_REMOVE_PE_DMA_WIN, DDW_APPLICABLE_SIZE } IMO, it looks better than all the defines before. What do you think? Best regards,