Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1177973lqb; Thu, 18 Apr 2024 02:23:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0OKV85nV1Oo+KLWhtHi+dQoE8uNnmwNqqP5XMk2vpNfmccnSF72DyOoJronDn7Se3COvEHwrtqWA3zUQn893/+jgAbq9Yo76nags8zA== X-Google-Smtp-Source: AGHT+IEzRujY4ZAyXHA2ju5eqZDznhU4Hw/CSKChcXCGdLQEuUH6fmMscNnTybGTiB49XsQRF6Qf X-Received: by 2002:a05:622a:1a1b:b0:437:872c:2407 with SMTP id f27-20020a05622a1a1b00b00437872c2407mr2943419qtb.28.1713432237238; Thu, 18 Apr 2024 02:23:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713432237; cv=pass; d=google.com; s=arc-20160816; b=WBODWGim5XOdFdxH1/fJ1X/dz20tWGoBgYUWf+xf+cG3udk1ovI+CH5D6snHbvEQr7 SfWrXQp6pW2ftBm9F4nCmYnGVfxjOLvOw84QHd5kwCT4/+JrjVnBaPHScLDUj5BQqkJT obSR57WmrymVk4qbBsWxBIi7NbdCgXQ4bVBUWqdJpSRwWFszr27M/zJKhMi4ww8yXq5f wj9y/jaEx/jJuJQUz0vqerE4G5l9t9B0ck+JoSRAG208A5xsn0MYCcZgNT/KJtNQS6cx ytZenWTHxrytWONewRqwyXP0970C9oOAtG05j8Kf1X8fmJ6dEfrexpuKOzGTjYVNRyuY hHJw== 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=OvkJ3JJBdTmm0oyGBN0bERJHPObwKkGyJk/XH2hv2+w=; fh=5EQyDiYgg+kua2A2AF9eJME8jasrrRA/Pgg86y+lzvY=; b=xvxJa/MqlKs3R7tRVeoY1K/jtpshxgchbJA6suUL4ML8KSdn0RNTlQND007O7KnEBy vnM/hvKfolaQXhLww0QKPpmWfUDGIAHlUjedkDCGY2wfdxh83V3o+sz86VLMRQ0X1ccb nb9xIiTYxDf71Cj5nfQQ/DCqeVkDO4V/echXbXruIrY01tOi1mMI9KAMr4cYf5Ag3vwi QS+9sgFgdfPjzmnPDL7qLp7+0w1RMKgGql+b9OeH2GPKBDJjjuvyIYxe/dGM3Aoq3aY6 AMNuK6Ibc7uJ7YL4evryJGKmjlZIEsZmpfhkwejyhZgJHlcGEiJYBZa0vdMNfKQRoSpr raRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=ctH0zVQ4; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Q4mf2IQx; 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-149793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m14-20020a05622a054e00b004367ce4dad4si998467qtx.486.2024.04.18.02.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 02:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=ctH0zVQ4; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Q4mf2IQx; 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-149793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149793-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F166D1C20BDE for ; Thu, 18 Apr 2024 09:23:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB6D15B573; Thu, 18 Apr 2024 09:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="ctH0zVQ4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Q4mf2IQx" 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 5B66115B121 for ; Thu, 18 Apr 2024 09:23:15 +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=1713432197; cv=none; b=IcQQS05w7Vh9bJI392uZzOytn/r6rn0xRXAbLM18zidsVhdaDGDR1TObEDBDIZl9xMf7oT0xpB1E1IkVCfZIML/auRhY2eRJxcrMjTakYCBewkUenJqR83e0qePolllSTRHtHnhibGPrcyG36ebkIcRfl9I5sASAMIIuiQzwJ+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713432197; c=relaxed/simple; bh=MJHBKudG/kZgwlUBFzIAt9k68zjMK0BJO59W1qx1VPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rsrIiZDTeA3vnhmIFY/v750lgQC1yA+euQH9XiJBRuF1qoKNVvbyZ2ttnZCtr3aE3z9vwa6rWm8f9oUEipPX9LXnc32C5p/jilSPYHioZsl5oXWk3hp0FWxQWf6KaAQCGahg8GM7lAgQZ20AE9QhgPkqhQJYv/nTyrjnJ71wrIA= 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=ctH0zVQ4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Q4mf2IQx; 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 compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 85F1F114011D; Thu, 18 Apr 2024 05:23:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 18 Apr 2024 05:23:14 -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=1713432194; x= 1713518594; bh=OvkJ3JJBdTmm0oyGBN0bERJHPObwKkGyJk/XH2hv2+w=; b=c tH0zVQ4ZTitLpU+ke2/lTpiDHDXdmoAMYVNGNzTlyRkSyyva+hgHao1T9pwfGvfy gSyMwMKFaD8OpoIQvE9tvVfOBshtUtYVyTywiNNlSfe68/xzXqWsT3DL7G4xdWtC YTuqEB+EFruLYcASXjA+4hYNmrGhVb8CdE4LS9lLfo2PCG5ryL7OIuVm9Y5FUS1h qT8x++ijTEIUwJHtJ2f5u3KWuKS8n9PSrzwi+Ggi0JdXq5ZKJcz+fiLrzfAc41qL 5/hwiYE1YN5NtWY7COADmHDaXHE9RisfE7YY6uwXLYbhC7lBlbFsPDvfAcOUg/tj ZhAx55r4l8IKbysZVeR3w== 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=1713432194; x= 1713518594; bh=OvkJ3JJBdTmm0oyGBN0bERJHPObwKkGyJk/XH2hv2+w=; b=Q 4mf2IQxAxI0eHnPnmAjs0ZebbcUqkdSCcXx9iHUuENbbX4onrSyFuQ5vBWEDOH49 rjN+xAIoBPjOH41ROBW6toI+kCXTfa4tDOZhgYNxxYuFC0sFTSrBX6budKb1L539 IGn6ZbDiZN+cbqcaNXr/2enPwlPQz+8TllTMjKDL5xJ2lJj4IBqyasLtyW7xpOVr ci4ourhEJfb8/YFx79kEIsAYH+dkq2VzQb05n/obEviDwD5VSOUHY+5dcApRDzS4 /8IB1ksTeXZTXRTCSYrGNAfEe+EJeQnDHbEmPBic7SnS1yQtFC58T0QwyLenKEvV QxVanQr8ZdbOzfAVW2S1w== 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:13 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/13] firewire: ohci: replace hard-coded values with common macros Date: Thu, 18 Apr 2024 18:22:55 +0900 Message-ID: <20240418092303.19725-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240418092303.19725-5-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In the helper function for logging in 1394 ohci driver includes the hard-coded variables for transaction code. They can be replaced with the enumerations in UAPI header. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 4666d941a2ae..85223a1c90a1 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -533,11 +533,17 @@ static void log_ar_at_event(struct fw_ohci *ohci, } switch (tcode) { - case 0x0: case 0x6: case 0x8: + case TCODE_WRITE_QUADLET_REQUEST: + case TCODE_READ_QUADLET_RESPONSE: + case TCODE_CYCLE_START: snprintf(specific, sizeof(specific), " = %08x", be32_to_cpu((__force __be32)header[3])); break; - case 0x1: case 0x5: case 0x7: case 0x9: case 0xb: + case TCODE_WRITE_BLOCK_REQUEST: + case TCODE_READ_BLOCK_REQUEST: + case TCODE_READ_BLOCK_RESPONSE: + case TCODE_LOCK_REQUEST: + case TCODE_LOCK_RESPONSE: snprintf(specific, sizeof(specific), " %x,%x", async_header_get_data_length(header), async_header_get_extended_tcode(header)); @@ -547,7 +553,7 @@ static void log_ar_at_event(struct fw_ohci *ohci, } switch (tcode) { - case 0xa: + case TCODE_STREAM_DATA: ohci_notice(ohci, "A%c %s, %s\n", dir, evts[evt], tcodes[tcode]); break; @@ -555,7 +561,11 @@ static void log_ar_at_event(struct fw_ohci *ohci, ohci_notice(ohci, "A%c %s, PHY %08x %08x\n", dir, evts[evt], header[1], header[2]); break; - case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: + case TCODE_WRITE_QUADLET_REQUEST: + case TCODE_WRITE_BLOCK_REQUEST: + case TCODE_READ_QUADLET_REQUEST: + case TCODE_READ_BLOCK_REQUEST: + case TCODE_LOCK_REQUEST: ohci_notice(ohci, "A%c spd %x tl %02x, %04x -> %04x, %s, %s, %012llx%s\n", dir, speed, async_header_get_tlabel(header), -- 2.43.0