Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp434525ybb; Thu, 28 Mar 2019 05:37:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdAUnu/3D8k0HhHDAtdo4ZUMTPp1EssVNBT10hHnTmkBm2A7bwmQJuAKT4/DhMufRa64cw X-Received: by 2002:a63:3185:: with SMTP id x127mr39529151pgx.299.1553776677108; Thu, 28 Mar 2019 05:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553776677; cv=none; d=google.com; s=arc-20160816; b=uAGhGj06BKnk1zt0KunOFlKu3QTFRm8YULiZWfQum8aRnqjTQMKbBJEmWaqJs9SPAF 1v8/4zC6gfR/0r+TMwVb65ttlgnuwj694glbsy/ltFQ3C21mM8pxpgIDhhSfxOEj7HHh FvOx2KOXn+9iVQe07N2b6r2Dx2Ya5msVcbSIaWQmawmLMSkCRs6d9+zKjl+SeXZOVRan cFdyMB2HVnSbp+QCQeyrBeuU7kI1krwFToPByGRmGpkLWzfe6nF7BM0gvWPocjidwJtl N4GEfGuSfxHnEhE3zkPQTXpR7+WgEgDxlVP/5pYvkrIAl2mtA+fNME1EYEE3X9ZzkO/j k/GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6l2AClMf/L41GR7k1QFyFVQgpoegWk1RNu7OA1Bpszo=; b=JUr1AdEver2VeyOWVpQCspHupsiSGU4/jeJgsAwp2kaUSBwT5+86a1UHx/V+ahZQF3 vXxHNOkQOxubNILLU2DYAoIgHU3JYndaSmZiHkiqQ1QhAY8yM0HEjwIVreS/+Cj+YLCp dcPBwzaHgJ4WuItaZ5YYi3ii1xzekiDxZwCeoWVY/HLxCGHLSyN25Qy/e+go52LcHgK7 vlhYxLBKlMVAg5y4gFlOO2w4R+ZfUdFlbjjpWzDkba75gNPRf9F0YUXYGjYFakLR9oRH 3ldMFmMtBf+TGuw/DyI9C1wI7wiqhQPZHjsvew6iSc8u1hFbJHztzTW19DR+u+mi00wX IajQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si12387590pgp.239.2019.03.28.05.37.41; Thu, 28 Mar 2019 05:37:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbfC1Mgu (ORCPT + 99 others); Thu, 28 Mar 2019 08:36:50 -0400 Received: from mga04.intel.com ([192.55.52.120]:9515 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727327AbfC1Mgr (ORCPT ); Thu, 28 Mar 2019 08:36:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 05:36:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,280,1549958400"; d="scan'208";a="286671465" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 28 Mar 2019 05:36:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 6C73E17DC; Thu, 28 Mar 2019 14:36:35 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Andy Shevchenko , Christian Kellner , Mario.Limonciello@dell.com, Mika Westerberg , netdev@vger.kernel.org Subject: [PATCH v3 33/36] thunderbolt: Make __TB_[SW|PORT]_PRINT take const parameters Date: Thu, 28 Mar 2019 15:36:30 +0300 Message-Id: <20190328123633.42882-34-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328123633.42882-1-mika.westerberg@linux.intel.com> References: <20190328123633.42882-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The printing macros do not modify the passed object so make them const. While there make tb_route() to take const parameter as well. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index ca53ec145e27..535ddd77138c 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h @@ -287,7 +287,7 @@ static inline bool tb_is_upstream_port(const struct tb_port *port) return port == upstream_port || port->dual_link_port == upstream_port; } -static inline u64 tb_route(struct tb_switch *sw) +static inline u64 tb_route(const struct tb_switch *sw) { return ((u64) sw->config.route_hi) << 32 | sw->config.route_lo; } @@ -410,7 +410,7 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer, #define __TB_SW_PRINT(level, sw, fmt, arg...) \ do { \ - struct tb_switch *__sw = (sw); \ + const struct tb_switch *__sw = (sw); \ level(__sw->tb, "%llx: " fmt, \ tb_route(__sw), ## arg); \ } while (0) @@ -421,7 +421,7 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer, #define __TB_PORT_PRINT(level, _port, fmt, arg...) \ do { \ - struct tb_port *__port = (_port); \ + const struct tb_port *__port = (_port); \ level(__port->sw->tb, "%llx:%x: " fmt, \ tb_route(__port->sw), __port->port, ## arg); \ } while (0) -- 2.20.1