Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1178287lqb; Thu, 18 Apr 2024 02:24:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1jA5JCwHDE+wTKPLvXCSL+uPrrVF0gvRUCOikMJ2bLReo4VRa/X4tclkrIc4YZVRR5lqKgIVQx6TLq60sqfwXqga4Hxq24/6z6AtoPg== X-Google-Smtp-Source: AGHT+IE54AUAD911o0DtjpdFwncipJIk+TX9nGlN3QzLOoguwIGZT9iUxE/05AYVfwA5ntGvd1SS X-Received: by 2002:a2e:914d:0:b0:2db:a9c9:4c5e with SMTP id q13-20020a2e914d000000b002dba9c94c5emr750331ljg.21.1713432282393; Thu, 18 Apr 2024 02:24:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713432282; cv=pass; d=google.com; s=arc-20160816; b=A3/LykpKePCgjys7zxNYos6/f7KcTslPO4pSlD5k9QTp1BcktZN1VIFK8zfWavA1Vr vXlUMKzPJuYHKdxeqE55OB/7TJezHZxTLMn4VB767DVc136wVYg6mwRSN/V0tFQyaPyG 0GygLcRrjlfb9A3MNtDxNe0SW/PG9ZkH7oDOvHoW0Tt3GnCw1b6aHbmGOwVuCw/xoNBk 56TX2j93mW9dQFrx60iNF98pHzNSXuCg0/8mgsYXMx7T8h0Ltejxzic3qEP8sNm6X52l J3+GGsx6zGkv6tPIr30o4d9HxPaHSnoix3AbYpLsGUpF1ugJemhysOsdHfN2kkru6H+h +bsA== 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=e+bYK+97MmRa/Ky4nfoRqpy88xXQ8TuiU/pcMg4OPnk=; fh=5EQyDiYgg+kua2A2AF9eJME8jasrrRA/Pgg86y+lzvY=; b=FaB61QykdW+MJH8WN0Ta2S+1DJ5/scCyqaojsSGj9Tuau5PdYtRvOLW0GIjR5J4+UC wA+E4E/Ct+XQLlPsSP9rJE7F7IzGoue6az6F0ZZTgmUdNNOiTnid/hXFMgzNJ/YS6Nxu EBa7MFBnSndP5TpAmkDgKpP9E6tjWCElVhPDJUftrPT63KFxrgfXZeTAfvDRMRVGlews nyptU04hETenWhi0fI5HhMgUfkPJ1MfWD3/zJOoE3BBJQUyp7tA5Zu79Cf2IMZ0pZE1s Jb6Ag63hNJ3cQtXBEkFHls9MzqpcSzUTEERHOpei56iiTuSA3rX9iaoqZhbsavdW63jk kx4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="jgCeem/i"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cvKw6z75; 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-149796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i9-20020a1709063c4900b00a4a37082313si641844ejg.700.2024.04.18.02.24.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 02:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="jgCeem/i"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cvKw6z75; 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-149796-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149796-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1AE411F223CB for ; Thu, 18 Apr 2024 09:24:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 232C415D5CD; Thu, 18 Apr 2024 09:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="jgCeem/i"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cvKw6z75" Received: from fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (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 7438F15B98B for ; Thu, 18 Apr 2024 09:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713432200; cv=none; b=qbReITEpWhyJciIDHb4sLsoutQJ5evPCoWPMUTGpcA5q3adDWXpyA2F9a4hpN8CegxwDCdK2ca/XQ32k7PZjYIreU7ZHbj0wVF3sUKB88epWBlaPanEFPO1movhP2bLhIujTJddgWdCYnXg5lkCwDj4m99wcGGHAFsffZVpifgU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713432200; c=relaxed/simple; bh=pLO3FhGZaNArOcfH1KMiwUqgnwV+BSPoHLgSZPIR818=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=baqrkqgxfdFI/ICfYBX55WoomTaxeIyQBebKkPSx/hjVLEZs5yTSqaRRsKt2I0ZKClHWYog1jj5orwM3MqHV/nAW5mB4gc+SnI8PQg99vvb7Owv92DeRuktu9tGkbk3kzfaW2GjoWI6WyEzbSUTn6gLCrq+q0xdKtYRZOWCQjeU= 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=jgCeem/i; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cvKw6z75; arc=none smtp.client-ip=103.168.172.153 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 mailfhigh.nyi.internal (Postfix) with ESMTP id B32541140121; Thu, 18 Apr 2024 05:23:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 18 Apr 2024 05:23:18 -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=1713432198; x= 1713518598; bh=e+bYK+97MmRa/Ky4nfoRqpy88xXQ8TuiU/pcMg4OPnk=; b=j gCeem/i7hOGoJRPWD74Y3vg3gZGNQI/Qhd9qZcr/JywlZHsDHxXzKWnijdRHicqu SnwI9xah4cAhL45tSb415zZvwiRJx+SaAWdQ+OOLU2UIdZI1ADN1gbI98gbS2tTc 9TX43SK4iZ50dTtXt/h4WEa2nMn7OjFNRib1maEyhxnl/SmUsaXq0jenZZom1Q2G wnG/Z/RtyvJC6a+TkQs9P2OrbUrRuoLUWcg/K3PpA4XvMfAot632tcqgCHhX5d/E JJrcOMKoaKi4W9u3kNq9a97GtQjSNQafrm5qQoaYRQJUaopKKywulVsvfdgvBnTW HzPzvQ1vQQqBFBYUt1yxQ== 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=1713432198; x= 1713518598; bh=e+bYK+97MmRa/Ky4nfoRqpy88xXQ8TuiU/pcMg4OPnk=; b=c vKw6z75l+Ubezx6INQOX/CDgZ6CpU1UJwgSUlnOkAuu0qlcqGkS3Di5c6jeWZX/G jmuWvwkc/rrN0g6EvtvmUvL23IatpwBs4C313qWCKxCIpyEnUOXIB3bhpuUMQLW3 XDqlW8zJaZCnHoVP8hczWbfjwA8xOV4wZhvOt8ulOLlTIdY69UV08aGQryqIZQ8i QoyhI6v+/Sk0Pqmx/e2gYP9gz2gq/htvHpF8zhlHUDOxd496FNefLxWnMxt9lsfW cQzCIGeBRJAaOgMxDjfw2uzI8uhIR5ui/7OvIwM0sn5nnk6lqTJjaz1GnfVIz1Mk 0zaU05xjQ24s9SVKEb55w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudektddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Apr 2024 05:23:17 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [RFC PATCH 08/13] firewire: core: replace local macros with common inline functions for isochronous packet header Date: Thu, 18 Apr 2024 18:22:58 +0900 Message-ID: <20240418092303.19725-9-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240418092303.19725-8-o-takashi@sakamocchi.jp> References: <20240418092303.19725-1-o-takashi@sakamocchi.jp> <20240418092303.19725-2-o-takashi@sakamocchi.jp> <20240418092303.19725-3-o-takashi@sakamocchi.jp> <20240418092303.19725-4-o-takashi@sakamocchi.jp> <20240418092303.19725-5-o-takashi@sakamocchi.jp> <20240418092303.19725-6-o-takashi@sakamocchi.jp> <20240418092303.19725-7-o-takashi@sakamocchi.jp> <20240418092303.19725-8-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 24febc23c0c4..52d8d483c178 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