Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jul 2026 16:39:58 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Richard Scheffenegger <rscheff@FreeBSD.org>
Cc:        dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: f22b08443f6a - main - tcp_hostcache: explicitly typecast atomic_load_int to (int) for comparison
Message-ID:  <1164685882.1011.1784903998087@localhost>
In-Reply-To: <6a5f8e76.23f2e.57e0367f@gitrepo.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi,

This commit message is telling *what* the diff changes. And is a bit redundant in that sense.

I was surprised that the linked review has a very nice explanation of *why* this change was needed.

I think it will be very valuable to future commit readers to include the *why* in the commit message. The *why* in the message, the *what* is already in the diff.

Regards,
Ronald.

 
Van: Richard Scheffenegger <rscheff@FreeBSD.org>
Datum: dinsdag, 21 juli 2026 17:21
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: f22b08443f6a - main - tcp_hostcache: explicitly typecast atomic_load_int to (int) for comparison
> 
> The branch main has been updated by rscheff:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=f22b08443f6ae3620dd14ade4e2376b8531fd6f3
> 
> commit f22b08443f6ae3620dd14ade4e2376b8531fd6f3
> Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
> AuthorDate: 2026-07-21 14:51:02 +0000
> Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
> CommitDate: 2026-07-21 15:20:32 +0000
> 
>     tcp_hostcache: explicitly typecast atomic_load_int to (int) for comparison
>     
>     Sponsored by:   NetApp, Inc.
>     MFC after:      1 week
>     Reviewed By:    tuexen, #transport, markj
>     Differential Revision: https://reviews.freebsd.org/D58360
> ---
>  sys/netinet/tcp_hostcache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
> index e5c20b6f2475..fbf81b1f2303 100644
> --- a/sys/netinet/tcp_hostcache.c
> +++ b/sys/netinet/tcp_hostcache.c
> @@ -768,7 +768,7 @@ tcp_hc_purge_internal(int all)
>                 "bucket length out of range at %u: %u", i,
>                 head->hch_length));
>             if (all ||
> -               atomic_load_int(&hc_entry->hc_expire) <= 0) {
> +               (int)atomic_load_int(&hc_entry->hc_expire) <= 0) {
>                 if (hc_prev != NULL) {
>                     KASSERT(hc_entry ==
>                         CK_SLIST_NEXT(hc_prev, hc_q),
>  
> 
> 
> 

 
[-- Attachment #2 --]
<html><head></head><body>Hi,<br>
<br>
This commit message is telling *what* the diff changes. And is a bit redundant in that sense.<br>
<br>
I was surprised that the linked review has a very nice explanation of *why* this change was needed.<br>
<br>
I think it will be very valuable to future commit readers to include the *why* in the commit message. The *why* in the message, the *what* is already in the diff.<br>
<br>
Regards,<br>
Ronald.<br>
<br>
&nbsp;
<p><strong>Van:</strong> Richard Scheffenegger &lt;rscheff@FreeBSD.org&gt;<br>
<strong>Datum:</strong> dinsdag, 21 juli 2026 17:21<br>
<strong>Aan:</strong> src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org<br>
<strong>Onderwerp:</strong> git: f22b08443f6a - main - tcp_hostcache: explicitly typecast atomic_load_int to (int) for comparison</p>

<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px">
<div class="MessageRFC822Viewer" id="P">
<div class="TextPlainViewer" id="P.P">The branch main has been updated by rscheff:<br>
<br>
URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=f22b08443f6ae3620dd14ade4e2376b8531fd6f3">https://cgit.FreeBSD.org/src/commit/?id=f22b08443f6ae3620dd14ade4e2376b8531fd6f3</a><br>;
<br>
commit f22b08443f6ae3620dd14ade4e2376b8531fd6f3<br>
Author: &nbsp;&nbsp;&nbsp;&nbsp;Richard Scheffenegger &lt;rscheff@FreeBSD.org&gt;<br>
AuthorDate: 2026-07-21 14:51:02 +0000<br>
Commit: &nbsp;&nbsp;&nbsp;&nbsp;Richard Scheffenegger &lt;rscheff@FreeBSD.org&gt;<br>
CommitDate: 2026-07-21 15:20:32 +0000<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;tcp_hostcache: explicitly typecast atomic_load_int to (int) for comparison<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Sponsored by: &nbsp;&nbsp;NetApp, Inc.<br>
&nbsp;&nbsp;&nbsp;&nbsp;MFC after: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 week<br>
&nbsp;&nbsp;&nbsp;&nbsp;Reviewed By: &nbsp;&nbsp;&nbsp;tuexen, #transport, markj<br>
&nbsp;&nbsp;&nbsp;&nbsp;Differential Revision: <a href="https://reviews.freebsd.org/D58360">https://reviews.freebsd.org/D58360</a><br>;
---<br>
&nbsp;sys/netinet/tcp_hostcache.c | 2 +-<br>
&nbsp;1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c<br>
index e5c20b6f2475..fbf81b1f2303 100644<br>
--- a/sys/netinet/tcp_hostcache.c<br>
+++ b/sys/netinet/tcp_hostcache.c<br>
@@ -768,7 +768,7 @@ tcp_hc_purge_internal(int all)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"bucket length out of range at %u: %u", i,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head-&gt;hch_length));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (all ||<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;atomic_load_int(&amp;hc_entry-&gt;hc_expire) &lt;= 0) {<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(int)atomic_load_int(&amp;hc_entry-&gt;hc_expire) &lt;= 0) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (hc_prev != NULL) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KASSERT(hc_entry ==<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CK_SLIST_NEXT(hc_prev, hc_q),<br>
&nbsp;</div>

<hr></div>
</blockquote>
<br>
&nbsp;</body></html>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1164685882.1011.1784903998087>