Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1026920rwn; Thu, 8 Sep 2022 12:11:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fSDoo8qlpHEP1tKRcY/w9kxa2pmQPVFz0dyjk5JsMv0SssAfuiE11pYmFeh+MSrhJq5iE X-Received: by 2002:a17:902:db0e:b0:177:e590:df8d with SMTP id m14-20020a170902db0e00b00177e590df8dmr7732827plx.157.1662664306668; Thu, 08 Sep 2022 12:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662664306; cv=none; d=google.com; s=arc-20160816; b=hWEnQeaLLyZ22Olm6FPlcUNYGG0MrjExJcaKCx57v1/idFAeG8AWvEfZtdAhdA5Ae3 NAOmwpt9jdJzLYqCcKEbtwDF41D8XZEEK69DlQbAPHX+xme4iWhays0KtAec7w00lfHu NdbcUqPWQfim0AhT3TSg99OPo6lVSx2sn3dJslB7ziV99jBfYVy/gN13aip67iKXJGlh LrmMfyaUr1GF50/2HRderVIel3/iHNZiLoum2/9/bpQyYoU6EthFxX838XvyQVnTwnx4 MqXEd+vk6s+sA57GdkPdaIFM2CEywN2r2Uom9eBat0zfcnpCr965roM6XrkpB4VDke27 RxGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=J/y9XKb5PhkgeKPmY6A0dNBgBd1yRQuu2tAplqpDtLM=; b=EiwG2T5+fsH/nSrJfuQ9OL/5I+92rygYxQryam+DyLMBLX5YSBiX0C0ePcHfZWgFJZ h99DSmD7XwZkPKbm5/TCRromC5rClsHfa7w20SihctWCdtqTsZui3LWfamEMsd3tH0f6 IBPXy+RBOCxODiojOPGprT1NXddam1Sd7o5dXNVPTwSuGagaqVMTmG8ITMDKf6sIItGe +ZENjlHB3mjXjgZDkAhCV+OXPecN7SP96w+DKv1/Qt//yn+rherISAIPXiuvRpDJBkpZ kAywNv9X+Ze1WscYBhkygcCngX4etPDwzlXYhjDJG2WQKCgd2OMtYh1cxMnT6ZlTKtWh /O6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eS3FwQVz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a656794000000b0041d7e887487si22700041pgr.695.2022.09.08.12.11.34; Thu, 08 Sep 2022 12:11:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eS3FwQVz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbiIHReR (ORCPT + 99 others); Thu, 8 Sep 2022 13:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbiIHReO (ORCPT ); Thu, 8 Sep 2022 13:34:14 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA89BC58C3; Thu, 8 Sep 2022 10:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662658453; x=1694194453; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=yPoPiu4s5AIvWYRtd6XRgDWLB41yZsUhqTPTHKz4Q3c=; b=eS3FwQVzLLKg3O67WOwhilfi72KLy1lY/LqABwz1kdblZii5iG4FBIXv /wIyAu4Wh2UuF918bctkB/Tcvx2zS+VbQ5bGYqiDi5SoILhYwmy2/lRau aw918TQ2vo0aJqZREtayrb8g7JPcMi1HLPAowTTP0CtL/dV+fBOmes7vG BVdI4OJyemvRKAm2X3zwL3kbfn4fEmFTihf/ZIXtuJ1nMOEJzqENN9XxQ +CpqIe0vvgoTWsJPBrkNL1R5dGlreewGljci0CQF977ParNRQLAW5g26k wvTSHcTB9zjxksVoLnuYWAjCsorWVCkTL4KC2lMoNB9xjEttV7muoNuJq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="298611243" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="298611243" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 10:34:13 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="676796260" Received: from rhweight-wrk1.ra.intel.com ([137.102.106.43]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 10:34:12 -0700 Date: Thu, 8 Sep 2022 10:34:07 -0700 (PDT) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@rhweight-WRK1 To: Andy Shevchenko cc: hao.wu@intel.com, yilun.xu@intel.com, russell.h.weight@intel.com, basheer.ahmed.muddebihal@intel.com, trix@redhat.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tianfei.zhang@intel.com, corbet@lwn.net, gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, jirislaby@kernel.org, geert+renesas@glider.be, niklas.soderlund+renesas@ragnatech.se, phil.edworthy@renesas.com, macro@orcam.me.uk, johan@kernel.org, lukas@wunner.de Subject: Re: [PATCH v1 4/5] fpga: dfl: add generic support for MSIX interrupts In-Reply-To: Message-ID: References: <20220906190426.3139760-1-matthew.gerlach@linux.intel.com> <20220906190426.3139760-5-matthew.gerlach@linux.intel.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 8 Sep 2022, Andy Shevchenko wrote: > On Wed, Sep 07, 2022 at 02:37:32PM -0700, matthew.gerlach@linux.intel.com wrote: >> On Tue, 6 Sep 2022, Andy Shevchenko wrote: >>> On Tue, Sep 06, 2022 at 12:04:25PM -0700, matthew.gerlach@linux.intel.com wrote: > > ... > >>>> + if (fid != FEATURE_ID_AFU && fid != PORT_FEATURE_ID_ERROR && >>>> + fid != PORT_FEATURE_ID_UINT && fid != FME_FEATURE_ID_GLOBAL_ERR) { >>>> + v = readq(base); >>>> + v = FIELD_GET(DFH_VERSION, v); >>>> + >>>> + if (v == 1) { >>>> + v = readq(base + DFHv1_CSR_SIZE_GRP); >>> >>> I am already lost what v keeps... >>> >>> Perhaps >>> >>> v = readq(base); >>> switch (FIELD_GET(DFH_VERSION, v)) { >>> case 1: >>> ... >>> break; >>> } >> >> How about? >> if (FIELD_GET(DFH_VERSION, readq(base)) == 1) { >> ... >> } > > This one tends to be expanded in the future, so I would keep it switch case. > I'm okay with using the switch statement, but how about the following? switch (FIELD_GET(DFH_VERSION, readq(base))) { case 1: ... break; } > -- > With Best Regards, > Andy Shevchenko > > >