Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1727913lqg; Mon, 4 Mar 2024 01:39:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXgNWsrNMcO5HU0zRZ/DI9W17OX6CCbCN2TsvFAayQrQMWALZ7e8+MjXI6JxYzdFPFczuzIJjl5Cul7ofe86nc7HBR2ASGhH+SXarSBwg== X-Google-Smtp-Source: AGHT+IFOCEAf/38A+UQHbnsyCxkUfQu284KYWU7Ul4jFJmqHct3pvdZZO+dWycgaP6TTKszpL/nP X-Received: by 2002:a05:620a:391:b0:787:84a3:45aa with SMTP id q17-20020a05620a039100b0078784a345aamr9384218qkm.52.1709545186944; Mon, 04 Mar 2024 01:39:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709545186; cv=pass; d=google.com; s=arc-20160816; b=mDXvNKFm/3Q50mF5xKbogY/IkzdJQJ4i6WOQCLD3Cbp4kAaQjC+YPjaLwv5LV/bv+n N5elqeT/uf/Np96XKnfquY4MSCLQGSVUVhMNgs2X5cWavQQCcPudz/JETYgzCn9X7leD fG075p0KNmbJGL2WrvFZsD++AZSbNNx/EAuw2scKfwIw4DANl6fOv09pR7GOob4OKLZG +qsLYiabwo9hnLnEGXvYyAsqWCZrrHKAvC54tquUWvZrSG8NVboSazk1PLTPwFtLytjB a8aLZbppZYYToKgLSg04L/GjAiZ3q6qEJ1h1oO0/ALWPDnHbcpC6HcXDYk1vogEOfr+D 6ZGQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=3mjYo148TYL75N4xxdKNBZ+5b0p2poE7mksZ1cmgcGs=; fh=BRJdJ8eSIWYnn3PQLWNjL7Sj2lMkPxI7GaEaArXyWqs=; b=ZlaCLmHUeTgHQUvbsM6YDU19OCFERy5NOwBd8FbDW0d+DntOueUMJjK2DlcsiTfCM3 J1lD3+m1N8iTqRizjvYwIPQH7GQV890UmXgvkFnlpDc5tKY2enzj7Z+fA5iCDVjkyuB3 itmA4RPDH5tfejVMZQ3SWxIO/FVyJ+xi8nJIg/99e6U1a/MdRVzyOjVxbbVCWOTbwg+T QWhfbST9lOl8MnzIL2CBVuGZfvf6HQc+hKyI+oR3d2cOAp1mKBCmAifum8M75C4PM3wm Wkq8avn5pVW4GTkxDX5Jlk55kI9CMZfBR51W811YycAcC0mzLHIvHSPg9jeR5ErxiO2D Relg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=B4wQlWFu; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-90335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i21-20020a05620a145500b00788252f3926si2427635qkl.712.2024.03.04.01.39.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:39:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90335-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=@denx.de header.s=phobos-20191101 header.b=B4wQlWFu; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-90335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de 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 A74911C225B8 for ; Mon, 4 Mar 2024 09:39:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 171942134F; Mon, 4 Mar 2024 09:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="B4wQlWFu" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F37225A6; Mon, 4 Mar 2024 09:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709545179; cv=none; b=suPzyaffOaVkq8Fn5v5+3rhKEwBcwW/GGXsIIPInwwH4s7zwEdKlXcSgygcetRA8H+kuBh3c7fRm/DqjXqlAP5H6X1LMJ7QH03otBb3ZHMMtGPC+HyHnXVvH6GZwkjMVEE251rcC6Z0zSzxsqtR1rYeAZrCxiXKmPFeP9CjORD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709545179; c=relaxed/simple; bh=so6Y8pkPttl1YpSq6PwnluDXvxHzVQSAipo3aqdm4rQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=soebuzgKQ686Go6zfVK385q4NAal2oMSMHdJqmvqCnl9wUHtEuTSbs2cboSisQKxnCrb0Lk4JYoQstz1/57qSq7SDzF1xq+uGa6KZxMPBws1W0IaylJmyza44jk2x9BrleSrV0RgvPJAZXUZWzA5wjZDnpRP6LT7nXvJSIxfB8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=B4wQlWFu; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 919D887F3B; Mon, 4 Mar 2024 10:32:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1709544765; bh=3mjYo148TYL75N4xxdKNBZ+5b0p2poE7mksZ1cmgcGs=; h=From:To:Cc:Subject:Date:From; b=B4wQlWFu0TlrMAXRRHiJ/1D7JCdBO1NarLWib8Jp+Nk6JODFxrlROIIUmhG1zslwL vVzhbFk4FkUG4JVX42gDd7V7UA8LrUlycBjXlMeM4JCsTPPT8gpLve94Dlk9Li0S/B 6txGU93/SmS2Su6kl4O5MNVqql9M9bCx6xA8g+PIHjVnkVHMVn/IL3o43k8e2QOWIQ umRoNYNWsKzxKxo2M5pSMH10UUHY7cs4X+pt+Gd0/wOWrRB1/4YXM2HlShpxogktVo tX9X5qn2A/TWwqZXX9QRDktxma70W7MIpaRpS4aZPTUtCb7hgaSTHWtldk5IaX0H/W P78wKhYTHk9KA== From: Lukasz Majewski To: Oleksij Rempel Cc: Eric Dumazet , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Tristram.Ha@microchip.com, Sebastian Andrzej Siewior , Paolo Abeni , Ravi Gunasekaran , Nikita Zhandarovich , Murali Karicheri , Ziyang Xuan , linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [PATCH] net: hsr: Use full string description when opening HSR network device Date: Mon, 4 Mar 2024 10:32:20 +0100 Message-Id: <20240304093220.4183179-1-lukma@denx.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Up till now only single character ('A' or 'B') was used to provide information of HSR slave network device status. As it is also possible and valid, that Interlink network device may be supported as well, the description must be more verbose. As a result the full string description is now used. Signed-off-by: Lukasz Majewski --- net/hsr/hsr_device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 9d71b66183da..9a60489fba96 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -142,30 +142,29 @@ static int hsr_dev_open(struct net_device *dev) { struct hsr_priv *hsr; struct hsr_port *port; - char designation; + char *designation = NULL; hsr = netdev_priv(dev); - designation = '\0'; hsr_for_each_port(hsr, port) { if (port->type == HSR_PT_MASTER) continue; switch (port->type) { case HSR_PT_SLAVE_A: - designation = 'A'; + designation = "Slave A"; break; case HSR_PT_SLAVE_B: - designation = 'B'; + designation = "Slave B"; break; default: - designation = '?'; + designation = "Unknown"; } if (!is_slave_up(port->dev)) - netdev_warn(dev, "Slave %c (%s) is not up; please bring it up to get a fully working HSR network\n", + netdev_warn(dev, "%s (%s) is not up; please bring it up to get a fully working HSR network\n", designation, port->dev->name); } - if (designation == '\0') + if (!designation) netdev_warn(dev, "No slave devices configured\n"); return 0; -- 2.20.1