From nobody Sun Apr 5 13:04:12 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 C620E38838F for ; Tue, 24 Mar 2026 14:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363621; cv=none; b=prjbSsmzWNTVBG72bCReErVRxs5KXVUZFuBd3noiH107ORyO5R48vuSM9Yg154qXVeCqnKfqcH79mota/4Y09JWnvJcM4iA5yvm5T6aQAWZJ8q/ANZNiGPL//lfT5YmNJOXrjlEuOmOKGoIFT5Hj7waUzeoInQ0NUAeSwGTOoLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363621; c=relaxed/simple; bh=+vw2JkvCXKRoQRcER3jPQEIB++vTT0CoMaEKfyNHHnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hi0gegW/IxY8FCvXmQmHjKqoCnemu3LqH4umxjuZ0QVLYviGCGBCQ8x3X0WA9Q+oLNhsw3N1gIh76cMx/ejWqs5F9/7rdYJzyLQidOLPJMKMKKOr3SBvrsdWuFqS97672AB7fTYq16qme+7nU075kpuhL+eM7pgmiiOsA3cqgWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=LzZiI3Ea; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LzZiI3Ea" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HCZCqssiuCqpmDoMVvWj4+RE/eoOZ2EbUqziqvm6HAE=; b=LzZiI3EaV3xqq8q2cS9KbpOrXyVJPdlw6PFnemCb943VNufnok1Vu1LyHe0hZxrfDepRON wSifnPrhgC8LuV17KcCqVSh3cQdN5C7Ua2Pp7KdEFgLSROMCscYZmOtT+ehb8gibbvhAL7 /cSQR3R+mWvcYU5F8nL3wsO6b7BjfUY= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 1/7] net: hsr: constify hsr_ops and prp_ops protocol operation structures Date: Tue, 24 Mar 2026 15:46:24 +0100 Message-ID: <20260324144630.189094-2-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak The hsr_ops and prp_ops structures are assigned to hsr->proto_ops during device initialization and are never modified at runtime. Declaring them as const allows the compiler to place these structures in read-only memory, which improves security by preventing accidental or malicious modification of the function pointers they contain. The proto_ops field in struct hsr_priv is also updated to a const pointer to maintain type consistency. Signed-off-by: Luka Gejak --- net/hsr/hsr_device.c | 4 ++-- net/hsr/hsr_main.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 5c3eca2235ce..90236028817d 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -616,7 +616,7 @@ static const struct device_type hsr_type =3D { .name =3D "hsr", }; =20 -static struct hsr_proto_ops hsr_ops =3D { +static const struct hsr_proto_ops hsr_ops =3D { .send_sv_frame =3D send_hsr_supervision_frame, .create_tagged_frame =3D hsr_create_tagged_frame, .get_untagged_frame =3D hsr_get_untagged_frame, @@ -626,7 +626,7 @@ static struct hsr_proto_ops hsr_ops =3D { .register_frame_out =3D hsr_register_frame_out, }; =20 -static struct hsr_proto_ops prp_ops =3D { +static const struct hsr_proto_ops prp_ops =3D { .send_sv_frame =3D send_prp_supervision_frame, .create_tagged_frame =3D prp_create_tagged_frame, .get_untagged_frame =3D prp_get_untagged_frame, diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 33b0d2460c9b..134e4f3fff60 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -202,7 +202,7 @@ struct hsr_priv { enum hsr_version prot_version; /* Indicate if HSRv0, HSRv1 or PRPv1 */ spinlock_t seqnr_lock; /* locking for sequence_nr */ spinlock_t list_lock; /* locking for node list */ - struct hsr_proto_ops *proto_ops; + const struct hsr_proto_ops *proto_ops; #define PRP_LAN_ID 0x5 /* 0x1010 for A and 0x1011 for B. Bit 0 is set * based on SLAVE_A or SLAVE_B */ --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 C03B13FE641; Tue, 24 Mar 2026 14:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363620; cv=none; b=kUKUOsMpv93AjPCrnyFaVTA3mi6fyZOin1yx03i9QkjDojUfT5R/UA81yHpFQmCzccGs8l/Gf1wSbe8s22KoEoDaByc1VzZzmnB0ZaSB9PO/e/Rughyc3P2lNPPrXKpUmv+65Fn2/DVf1kHeZivzC/3sOMIvgtygugsK4Gk7Jrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363620; c=relaxed/simple; bh=/D0cfQ1mzSWmV2F+6UuVKYRFikwA13VAmraAgE++9NU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WB56bO3x8CaCIQ7/02Xg8ywqGuiOAYU7k0vPklGnk9NHGq9xuZ85/OXgWUsdPbmDc+Frn5Jad1h7IBchAibCRhqySnj1kae6x1RuQ2O5wrk+wIjtBNxNd2JOfoh6KJkgcHyanIU/p5H/bbjR01ALqWhDJvADrRB36a08uyDmPOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Pi3dpMEX; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Pi3dpMEX" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S/MqktP6Uup7dDGTg1J03eE+dsXyf5ZAXMqFkJo79oQ=; b=Pi3dpMEXxvyUD9eAbn3HQ1xwMWUy0hImy9Surjg8iyPWBbXNg9ToQzss0fjR14GSpts3+g hH7Y1xWK3Sy6RQlfk/aUJ9Ox/5hGslR0UTldEjxyWoT70de4z18ZQ6BZc4+cV+FKVyIwNZ eZ+5Bbr+4jAE2sz5oVoa0SsjzeR5CzM= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 2/7] net: hsr: replace fallthrough comments with fallthrough macro Date: Tue, 24 Mar 2026 15:46:25 +0100 Message-ID: <20260324144630.189094-3-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Replace two instances of the legacy '/* Fall through */' comment with the standardized 'fallthrough;' macro in hsr_get_node_status() and hsr_get_node_list(). The kernel has standardized on the fallthrough macro since the migration from comment-based annotations, which provides compiler-level verification of intentional case fall-throughs. Signed-off-by: Luka Gejak --- net/hsr/hsr_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index db0b0af7a692..32c1b77cf84b 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -433,7 +433,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, = struct genl_info *info) =20 nla_put_failure: kfree_skb(skb_out); - /* Fall through */ + fallthrough; =20 fail: rcu_read_unlock(); @@ -524,7 +524,7 @@ static int hsr_get_node_list(struct sk_buff *skb_in, st= ruct genl_info *info) =20 nla_put_failure: nlmsg_free(skb_out); - /* Fall through */ + fallthrough; =20 fail: rcu_read_unlock(); --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 A84D73FE67B for ; Tue, 24 Mar 2026 14:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363621; cv=none; b=SI/KPbjvLKA5CT3J9c86TSvWL2t0slsDf5EBnBvSzyhhqxz8IcQegisK7voebAZzqJeNdOo7E3y9c4pXDaPBxokGMArdlCwmRiREhGzZuQUNQcKaxAxjgTLZGbvIiCAeK0QhFKjYNY2VY9bc9mrZ2zTlFs1qugkPGqgjDsbT3jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363621; c=relaxed/simple; bh=AlLiZPGPdutZRZ5ykWkI80lYrQnEw/kcOcoZpXjLCJk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VdM/0bYv+ZUIVoteJC+FAfzjW56SS1DeePUXCZvi22YC1xgoVuKiKQWUN+LgcMDWWbUrDMMB1SVt5KiusL1NIjt/g82O96YIw75uV3AG/H295Ynt//eFYts6nMFKzgLFcBvtmhziMp0lo3CyyjaYd3zijEABOjMqNVH5XO5tBLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=niOiWhF6; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="niOiWhF6" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y4n5vM5kA5+y7gQTAZ8iS52yr87eahEjxM7+DmRQqiE=; b=niOiWhF619Uvnr2WgJdD8O8ebwlTSVXf65Ddhm6ApiD2CSDdLMdHSuOkYLRANPfeLTFn/a sRszAVLnOqmjtwuAOTS20OnISvaDg6/sn8E7NbJgOiNa3mrFXfs6QG+vfNEzccFKNDyGMb 5cloDZsHtlQDQ+JhUPsl4+zXNQgfy3A= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 3/7] net: hsr: remove unnecessary void function return statement Date: Tue, 24 Mar 2026 15:46:26 +0100 Message-ID: <20260324144630.189094-4-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Remove the trailing 'return;' from the end of the void function send_hsr_supervision_frame() per checkpatch recommendations. Signed-off-by: Luka Gejak --- net/hsr/hsr_device.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 90236028817d..6ffecc3f0004 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -363,7 +363,6 @@ static void send_hsr_supervision_frame(struct hsr_port = *port, =20 hsr_forward_skb(skb, port); spin_unlock_bh(&hsr->seqnr_lock); - return; } =20 static void send_prp_supervision_frame(struct hsr_port *master, --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 9453F383C6F for ; Tue, 24 Mar 2026 14:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363622; cv=none; b=eYdaMl6V5aYkTpri9AtA0Ew0lLDspMJ8AfDZv0FWxL2bWpFZeoFWWrmQFsrGLdZup5nKvpMEgRnFPiFXPtd3u2EvF4Im2tMlhjmhHFShfB48kzKbpBWuK1xkPx9o/wYlAo3qdCyIMC0lEBObvA7WLHTJHHqFGShAcTyFH7NgxkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363622; c=relaxed/simple; bh=j+f3uClfjMHsdo332pJtQTIhUZDYivfEjSJPDjJCbgA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YoBnvS3ZEdnUevSqB3Lv5DEzBQna0Q1b5UrySuaAc6T4O0K00KPLHKFWvY2LoqVFhnyjVyK/7TeNci1QcWadCQcoaK4mjkQKVZ5m1jCcD6MQWJCNMel/oeC3y2QDZL50f1JlmmHSDNjh9r2tllElnOLnB6fQ492xxPPeWfcrkhY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=o4kifuZb; arc=none smtp.client-ip=95.215.58.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="o4kifuZb" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KzyxAYRyx/x/x8wyor+HCtuz83L/riqOOKLGxAKi7fs=; b=o4kifuZbDlbin/3tH5IwKgVXnJEuIfOoLaAscIuI6G6YKXt5+3Smcg1ScPu89ypQvAWNKv 1wRzZ2G71/8iwrcLa/VtWWRDyb7gM9S5y8RW17mgPmrjRLw6560FSC1hawo81kWS/bzaJ0 eUw3uUAnOE9FEgYBC/TmNctuX/c2xwY= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 4/7] net: hsr: use __func__ instead of hardcoded function name Date: Tue, 24 Mar 2026 15:46:27 +0100 Message-ID: <20260324144630.189094-5-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Replace the hardcoded string "hsr_get_untagged_frame" with the standard __func__ macro in netdev_warn_once() call to make the code more robust to refactoring. Signed-off-by: Luka Gejak --- net/hsr/hsr_forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index aefc9b6936ba..0aca859c88cb 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -184,7 +184,7 @@ struct sk_buff *hsr_get_untagged_frame(struct hsr_frame= _info *frame, create_stripped_skb_hsr(frame->skb_hsr, frame); else netdev_warn_once(port->dev, - "Unexpected frame received in hsr_get_untagged_frame()\n"); + "Unexpected frame received in %s()\n", __func__); =20 if (!frame->skb_std) return NULL; --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 EAC48387355 for ; Tue, 24 Mar 2026 14:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363623; cv=none; b=Xt+OYnKx/yAMy21fcVVpaigKzNj1WeHjV8Ggaqu6xP7b6nNpaFVRCh9ajUNLzYg0+qlrQ6L/xA/oa9YVpW3mx1u1s0d3I5f+3u6xdirnVAE5easbqNXoOVq4CYU71nBjrmoPD4AQX5REsDyqwbiZY2aZIEVpmdmrU5XQGtz11Nc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363623; c=relaxed/simple; bh=Ayl+OLx/i5ZWc8NtQPBdVrs0HLr5T9vgoMdXbSSWHy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AiUyJYsY6IyZvunDKcobAznog+8bmnO7N6mFkLQztlBNruvtWR1UnOypzoDwAxm0rmpuOoRVO2La5alM9atZAEuLAQcyutBbeu75TrX5lN9c55eBA0gsewkoFI1pJTzvZtymp858rp6RBgnzlC4igLOxB0If7BAeckXm68cGNy0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qX9cKex/; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qX9cKex/" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TEP5bbaUGSX6Caw1GbV34m6S6/Z3qANCDebKYe4MrmU=; b=qX9cKex/ukGG0bSmEEquoTdiFy6ctYJz7dQKbPYZ27x7zp8q69cbbUeHM3tymHmlzPM85s IentBQB1HrmrQATyH0EdU4iRDCDly/k7LYbi8k3xTsK9FOy81XtJ88spdYkh8ALL3Rnhq0 2ekK9R7R521B96lCd6aF1Jz7UQKReCQ= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 5/7] net: hsr: remove unnecessary braces for single statement block Date: Tue, 24 Mar 2026 15:46:28 +0100 Message-ID: <20260324144630.189094-6-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Remove the unnecessary curly braces around the single statement for loop body in hsr_add_node() as per kernel coding style. Signed-off-by: Luka Gejak --- net/hsr/hsr_framereg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 577fb588bc2f..9c3b7381788e 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -182,9 +182,8 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *h= sr, * as initialization. (0 could trigger an spurious ring error warning). */ now =3D jiffies; - for (i =3D 0; i < HSR_PT_PORTS; i++) { + for (i =3D 0; i < HSR_PT_PORTS; i++) new_node->time_in[i] =3D now; - } =20 if (san && hsr->proto_ops->handle_san_frame) hsr->proto_ops->handle_san_frame(san, rx_port, new_node); --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 AEDAB3FFAB4 for ; Tue, 24 Mar 2026 14:47:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363625; cv=none; b=Zv++3gVjGkFhqaS2Mmykvcp0b+piJxy8PL3lZy7ZXHS/9ro35bJvj2AcbfDyjpxaadlfUxqCUTsBihR9DQQy3Lw8AsmNR+FQHZu/3r+TA+/4nJHgTYS504ufuMAgeCu4p8MIoPq593FDIJOJ2eEJyr8rt+U6UFZOcrK+wH/ev4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363625; c=relaxed/simple; bh=RHr+p+NJnyXnFaXgOkYd6TPAzRp0iVa/ExZnygRFp5E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YWqj2bi17A5c2/jhOuIB5OsSIIjjxrhGsvq9F8bD9FnmyfZKIrYOGaIaR162RieuNDdGJYfUaMLM2KhJV+iywnz6donlzsknWtG1Sw1YC+IRMpUuVFiL25Y01iQChDgOvZaq0t+rZYnFovYdkUhR0z7WadhitUotAtUhBf/spWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=w7iAhT65; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="w7iAhT65" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X8z0UgAXupqavXsuuN5PnUogUWGbsdMwKt2VfNlKKxU=; b=w7iAhT651RgNSlqI5hq0vDx5D+7cLrgs3dbFqu31rlh1+6Ir7V2GHWLMFwK7tnBWV+3VE2 gHvYJPIdGhb5O7xbxJv5Rer6mcR/qcGI/q1NJqAtKWpNRGH84cbDcbxRXO48Q9jUylHFOe 9+DkxAC6WqpwayW+/DKdYLP1rroYh/I= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 6/7] net: hsr: add missing blank lines after function declarations Date: Tue, 24 Mar 2026 15:46:29 +0100 Message-ID: <20260324144630.189094-7-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Add missing blank lines after the inline function declarations to comply with the kernel coding style guidelines. Signed-off-by: Luka Gejak --- net/hsr/hsr_main.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 134e4f3fff60..202dc90bd2ab 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -143,6 +143,7 @@ static inline void set_prp_lan_id(struct prp_rct *rct, = u16 lan_id) rct->lan_id_and_LSDU_size =3D htons((ntohs(rct->lan_id_and_LSDU_size) & 0x0FFF) | (lan_id << 12)); } + static inline void set_prp_LSDU_size(struct prp_rct *rct, u16 LSDU_size) { rct->lan_id_and_LSDU_size =3D htons((ntohs(rct->lan_id_and_LSDU_size) & @@ -277,24 +278,36 @@ static inline bool prp_check_lsdu_size(struct sk_buff= *skb, } =20 #if IS_ENABLED(CONFIG_DEBUG_FS) + void hsr_debugfs_rename(struct net_device *dev); void hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev); void hsr_debugfs_term(struct hsr_priv *priv); void hsr_debugfs_create_root(void); void hsr_debugfs_remove_root(void); + #else + static inline void hsr_debugfs_rename(struct net_device *dev) { } + static inline void hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev) -{} +{ +} + static inline void hsr_debugfs_term(struct hsr_priv *priv) -{} +{ +} + static inline void hsr_debugfs_create_root(void) -{} +{ +} + static inline void hsr_debugfs_remove_root(void) -{} +{ +} + #endif =20 #endif /* __HSR_PRIVATE_H */ --=20 2.53.0 From nobody Sun Apr 5 13:04:12 2026 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 6D28F3FFAC4 for ; Tue, 24 Mar 2026 14:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363628; cv=none; b=XORMq+9bANpuXDRyhSo3LWNOkBnGBiwMtnjcqOJDlmoGhu5LMDt9EU6C7poLq2001E4pOClXKvAv2NV5H9lGicgQOw/CtixbTuDl51ag0tKVQp3zYu7292Qca17yZOPQMH8/MH8T7S5HKq60U1B+7Ua/EIarXxTZUImGUwmawa4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363628; c=relaxed/simple; bh=T4a4e5KJlGe26Sd5S7YRg6XR4vrwYYgciWiIF7kRS/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OfLSrUmcwXrym1Mrmz0KRFTaJH/yNFQ+wjx3aoZZjxehrErpp3/chnLXpV9b2dHPfTqU6BGT2QtBL+kdS1IaIkgAtyWtMBk1ymLhTVlBQZGewdAJqnJiKodcUgIjAjl6VFjgWsdemO6hRPHPJYSenVext5/AHx6bYd/zKs6Rpus= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=J3aDI28f; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="J3aDI28f" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774363621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ueHmI5mgTDR5odOSYCRBX4DGBx1jlplYYGZFbMOOnE=; b=J3aDI28fJVnCH9KMA6XgE+JA8vUQnjwK7xGxLjOJ4xObeBKRb+6BWwhwuRdex1D3BW7VC0 mHRCXKq2H6w0s0AITyVHLasC/iLM78DqybL7D/ewu8JBYhtOp3cwezYk1xQ53vir9ZlAvR iHUR5nt3rdnJ2RNrSXYZKdxQR13Mlcw= From: luka.gejak@linux.dev To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: horms@kernel.org, fmaurer@redhat.com, liuhangbin@gmail.com, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH net-next v1 7/7] net: hsr: use BIT() macro for bit shift constant Date: Tue, 24 Mar 2026 15:46:30 +0100 Message-ID: <20260324144630.189094-8-luka.gejak@linux.dev> In-Reply-To: <20260324144630.189094-1-luka.gejak@linux.dev> References: <20260324144630.189094-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Replace the explicit bit shift (1 << HSR_SEQ_BLOCK_SHIFT) with the standardized BIT() macro for defining HSR_SEQ_BLOCK_SIZE. This improves readability and aligns with kernel coding conventions. Signed-off-by: Luka Gejak --- net/hsr/hsr_framereg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h index c65ecb925734..cb731ee0ce5c 100644 --- a/net/hsr/hsr_framereg.h +++ b/net/hsr/hsr_framereg.h @@ -79,7 +79,7 @@ struct hsr_seq_block *hsr_get_seq_block(struct hsr_node *= node, u16 block_idx); #endif =20 #define HSR_SEQ_BLOCK_SHIFT 7 /* 128 bits */ -#define HSR_SEQ_BLOCK_SIZE (1 << HSR_SEQ_BLOCK_SHIFT) +#define HSR_SEQ_BLOCK_SIZE BIT(HSR_SEQ_BLOCK_SHIFT) #define HSR_SEQ_BLOCK_MASK (HSR_SEQ_BLOCK_SIZE - 1) #define HSR_MAX_SEQ_BLOCKS 64 =20 --=20 2.53.0