Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp712863lqa; Sun, 28 Apr 2024 00:15:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKITCjEaK5GlGfCCTeoumTAiQhxTTWfk1QByPIMKr88dpBNbsYnkIHb97KpkJT00rkPzOe7ODVAj6qJIhQIqYUXuT1qVrZIpnlLB8ToQ== X-Google-Smtp-Source: AGHT+IFEoB53/60BN05Tp5SU1IL5UCWtG7G+lfZsp2xU7wICZ6JQQ8sJ8AF1wRiz2b3lJ1lYr44d X-Received: by 2002:a05:6870:b8e:b0:22e:bc50:3492 with SMTP id lg14-20020a0568700b8e00b0022ebc503492mr8439106oab.47.1714288542827; Sun, 28 Apr 2024 00:15:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714288542; cv=pass; d=google.com; s=arc-20160816; b=OgzGbvTkM1kxm+IR7k/bHsRnxZNL8APQNa4xKgfeE7mvpV36ac0iAFtucl97EyJID2 ueL/rQSu78wr6eH687cFGLB4pHtlO3rtz1pMK/VrPqBRv72n3t8KHUlzkXPSM2GDC+Lr VIX65OW8Nbiuq6LYo/EijfzprulmgYXNnxB/wUng4aKGHIrl7lsdp8UxPwS80aCna+US uDMgbS4w/558IO2p3a3qcRVOaWukDckxqOT/F9yAnpdv1iULLfyqvXZ8/GEgp4G3SuhY dV6oy/nQF6LPgiA2QcKkGdgFUpiJwa+ghRWQJIbYbq3tsEajJza13qzwf9tWpcINLKWo IVOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=lPogmESFCjjhKwyywY5ioCHwxWU0kxDIYwzD2LnEo2I=; fh=5EQyDiYgg+kua2A2AF9eJME8jasrrRA/Pgg86y+lzvY=; b=oU/1SRS/PpNRxwG9V6ZVbEVJBjvyeR3y4tgKWGY630jslfoHyVM3dGaLBRz0wsW6OP 42Xp8+RmYCElRvXK1OMS+YRVuVYO9z5dMoas5czWOU8kyEKCboVIbg+WHpCAb3Kgt8+L norKdKTywXR7FbKo1DWHU7irtzOuFiED9dzdRFx+4aZU+D+brE5NYD7w8yvaaNxIdY6w 86IXfT0/nyojvi7k7/soFhxS6N8zGFXe5aA7LH7oupSQ6UveIeeoCzlcQ56u3stXcKwc vvH0ofnnrsfyW/OS9xX6qHftSpbaSQRRhaQYg2a0AMO7EUmIp+ixaiNIEJ6iWAsRMXOo pSaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=ZwSTrBjY; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=FYhcsQzE; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-161304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h15-20020a63530f000000b005f76107ec97si17896358pgb.247.2024.04.28.00.15.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 00:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=ZwSTrBjY; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=FYhcsQzE; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-161304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 590BA281D4B for ; Sun, 28 Apr 2024 07:15:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B39575491B; Sun, 28 Apr 2024 07:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="ZwSTrBjY"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FYhcsQzE" Received: from wfout2-smtp.messagingengine.com (wfout2-smtp.messagingengine.com [64.147.123.145]) (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 28377548EC for ; Sun, 28 Apr 2024 07:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288452; cv=none; b=ApnxIKUN74Tp4vX+0gOeDUVKbDiv9QAfH6ppn9i3p+b/TxYAEwWmBsZJkCd0k0h3PzuQ3ziDpJ43W3W8mJTstFZuUWZaTY86zzpMd2eIN8Us9PL+n21HaUVTNE5XmUbFxvRMKRLvk8BvIHPP2Lbg0M6zleuJhI2SBSurhPb93hI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288452; c=relaxed/simple; bh=LCrACMQobUD1N2aJwOzCe0jVPAcOB6NcU9fKqGniKfw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V0PCUwqeCt3yXD23QFzbPyMQbOdUM57dEv1Mwk4KKEixoqeoYdir5WOwofrIn7KrOTcnwZAX39vUCVsx5hQ3SMkPcX2SKi9uZIOH9ezV9+FIfejK1HMuL8ail8H/4wp2fZmBjOyYv/tLpcx715laWBi5xqMal/qFUOPr5fPHs0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=ZwSTrBjY; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FYhcsQzE; arc=none smtp.client-ip=64.147.123.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 557BE1C00117; Sun, 28 Apr 2024 03:14:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 28 Apr 2024 03:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1714288449; x= 1714374849; bh=lPogmESFCjjhKwyywY5ioCHwxWU0kxDIYwzD2LnEo2I=; b=Z wSTrBjY43WI6YKaYmgDkI9Nst9YYYq6A4nsb1IJ5HuvrqQqtb5WGRD2tGZ9HW6QL H1Ly41PTSoY6oidRtPzI7ViCgxNHmhVElnFuk2OKl3zCP9IuiYvKunzbE4MR50VT O8/Mp+Uh5K08o3a/at7r/msylib5UJbZqQnG4khImEwsUTdrImTLpRQhc0CVH1H/ thuc+dV5hfMKKFnegc3Mu6prEjBJaEBTcGtbH1FLYRc6Nq6Ya1iY++FM7BrHspKR 6gSK3Zd61NBOT9f78gZ5fTFjBGoTzEVkOoSd9urLcyj3af1lc5zByXfJZC7QBXEf fhZvt0qIbeAxbMFKoa31A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714288449; x= 1714374849; bh=lPogmESFCjjhKwyywY5ioCHwxWU0kxDIYwzD2LnEo2I=; b=F YhcsQzE4PfsHqDm8r24CRLhIwR9M/lIzMWUtH0z6aNYUwdzM6N4EFeXxFLhe88EK gB9bnz3KWsh8wd0bAUZ4GICH3ggl7G9k0N15+bC9pjaISimxUqsk415vyb3Tnv7T N7gw75+4qddcXdKY+7qEPxbBclopI6R38bgV9s0nHV/Rj3PwPTCVs009uGsnVSiV xEcxZliPPvvtjmcKEt19Ys4E2rjZlelwiTux0Fg0ARjfaPVTlMFSsaY2wJXsgEMn WZWPG4Z8W1UjHf13Z2DtU7xq1vQ4vHiT2v0MAeVy0n5gUTSqaCUaO57taOlB01sJ tqVGckZGmmlGeGLh1XzlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Apr 2024 03:14:08 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 8/8] firewire: core: replace local macros with common inline functions for isochronous packet header Date: Sun, 28 Apr 2024 16:13:46 +0900 Message-ID: <20240428071347.409202-9-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240428071347.409202-1-o-takashi@sakamocchi.jp> References: <20240428071347.409202-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This commit replaces the local macros with the common inline functions to serialize the packer header for Asynchronous Streaming Packet. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 45ea15342ab8..3ecb0b945083 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -31,9 +31,6 @@ #include "core.h" #include "packet-header-definitions.h" -#define HEADER_TCODE(tcode) ((tcode) << 4) -#define HEADER_DATA_LENGTH(length) ((length) << 16) - #define HEADER_DESTINATION_IS_BROADCAST(header) \ ((async_header_get_destination(header) & 0x3f) == 0x3f) @@ -215,10 +212,11 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel, int ext_tcode; if (tcode == TCODE_STREAM_DATA) { - packet->header[0] = - HEADER_DATA_LENGTH(length) | - destination_id | - HEADER_TCODE(TCODE_STREAM_DATA); + // The value of destination_id argument should include tag, channel, and sy fields + // as isochronous packet header has. + packet->header[0] = destination_id; + isoc_header_set_data_length(packet->header, length); + isoc_header_set_tcode(packet->header, TCODE_STREAM_DATA); packet->header_length = 4; packet->payload = payload; packet->payload_length = length; -- 2.43.0