Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp936125lqs; Wed, 6 Mar 2024 00:57:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUN2LqcVQb1Sv8Tzg5ylEd8I3CRqB2RLwPFgPFPpC5IJgEBuD1A33P/dQ6hz7ULWW1YoHA2zNuNbOS0b+kS+iuixi31Jnr8gVasFaQNXg== X-Google-Smtp-Source: AGHT+IGTAsHbH62G24PbZjwdvSkiBzp90KFbyDLufoIzicnumGHaJ25J087BCDLVh1P68m1jaA9W X-Received: by 2002:a17:90a:8b8d:b0:29b:7a28:a795 with SMTP id z13-20020a17090a8b8d00b0029b7a28a795mr534351pjn.12.1709715473418; Wed, 06 Mar 2024 00:57:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709715473; cv=pass; d=google.com; s=arc-20160816; b=eml393cC/3xGVhWSkRKtk+Anob+gFsU6UY2utuKtprdfwFISUW4yy2Z/3uMEjXk0Ra YALOQ+Jgtqme83iXfnlWzGZF2JUlY+so8APEVBpPGd1ZhePj/A6727+yfs6g54tBnAyF utMTacH7vqNFNx0wHSepEzdesfY/v0qSJAyaCK14frobrqGgBhTFqMG+zQ/jlZ051C+1 y+4wdYrQSZgMZk07NQOuA/hA80KkzmYww2JCoo344F+Rm7YSBlG4Yenr4uLzEh+qV+E+ IRZJZl+0eCiLl2nYl2knW9Mn1wjAZT+HiE8o48cLcPVYSi0CNdbmcZ3S/0xq53NX9vyw MB3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=4oHOSDyiLL1mI+F9FoGEl6MkIz/9iq0u9FpW/2YUzIs=; fh=d6XhAzkkotYACpF8czipeQPTt3SxsHdxv69MIp0kwPo=; b=g9pE7Caq9v7qvWzZgYgBKYCBvJ1yltWKsDk7KHqQyaZ/qMnTyMyFdHYQKGQUk6kK4o 1V8rsJQwNw9xIXHFIeyLQ37C/A752Aj95R7upV2OGR2V1UiRW23wy1XY8IJAVIWHApJH UrkQnra8X8xhwCJk6KgQJ+JeDwBo53p2077qqbvW4YjKYamcKFidnMVv1XwWS8YbDUPl PHcNjrEdPnH4CWbXZSfaTJfMIs5iMTX+xZGfFyie2bfaUSLhDoCPtoBaWneRU4CBSPPz ZMvL2X3miTd7mEdXFJCCVaBr5xKJtkWEyrGJbX/wx6k9xzmf6mdRw17VIFPynjhTvote 9GtQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-93512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93512-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w3-20020a17090aaf8300b0029b0a37ba09si11568418pjq.160.2024.03.06.00.57.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 00:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-93512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93512-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 21BBAB26152 for ; Wed, 6 Mar 2024 08:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C7725D755; Wed, 6 Mar 2024 08:37:17 +0000 (UTC) Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D25842E641; Wed, 6 Mar 2024 08:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.78.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709714236; cv=none; b=S3/8jVErCVDmFY1gHAasRuj+UOrr49D0uZULcVks+nStnReajggxMGX2EdYHJyoModEhDlnoiqjJ08vKDCupzIfHs08Qr/uOWH1qrDBlT4ihEgbzUJxyyBWC6JiGrc7VbmC0TxJMjtLceh39iud7tmNhOArTf56bm+ho3k5ZEi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709714236; c=relaxed/simple; bh=pVkIVjusGyr1EkP89Dyn+PH2VQQIhsIQuXVHkrAagPc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z/9mlLKngE8jg3n7/FkAgXU+uVKM0/gZscFO4rzkyMKTMPOxusLqvS7XtapCwKcapYSIGFngenlkHWq5CEHqdlqFVLwjzhC4wb5qnrgbaER5Tfqgb0QEdg5KAVKv9wKfZ97D3LYX3PvsjelGY10hZerYg0w6DuKTNl+JHVEAOs4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.78.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id B631C2800B1A2; Wed, 6 Mar 2024 09:37:04 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id A48EC41192; Wed, 6 Mar 2024 09:37:04 +0100 (CET) Date: Wed, 6 Mar 2024 09:37:04 +0100 From: Lukas Wunner To: Alexey Kardashevskiy Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Dan Williams , Jonathan Cameron , Ira Weiny Subject: Re: [PATCH kernel v2] pci/doe: Support discovery version Message-ID: References: <20240226033114.3100118-1-aik@amd.com> <20240227204116.GA30259@wunner.de> <089cddf1-3686-4403-a480-07fddd66ab4b@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <089cddf1-3686-4403-a480-07fddd66ab4b@amd.com> On Tue, Mar 05, 2024 at 05:02:27PM +1100, Alexey Kardashevskiy wrote: > On 28/2/24 07:41, Lukas Wunner wrote: > > > + u32 disver = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_DISCOVER_VER, > > > + (capver >= 2) ? 2 : 0); > > > u32 request_pl = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX, > > > - *index); > > > + *index) | disver; > > > > Hm, why use a separate "disver" variable? This could be combined > > into a single statement. > > Less ugly since we want to keep it 80 chars long I don't quite follow, this stays exactly within 80 chars: u32 request_pl = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX, - *index); + *index) | + FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_DISCOVER_VER, + (capver >= 2) ? 2 : 0); And if you replace DISCOVER_VER with VERSION as I've suggested, it becomes even shorter: u32 request_pl = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX, - *index); + *index) | + FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_VERSION, + (capver >= 2) ? 2 : 0); Thanks, Lukas