Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2023 11:14:34 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f9a312f61ca2 - stable/13 - linuxkpi: Fix style for dma_map_sgtable
Message-ID:  <202302021114.312BEYFx076657@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=f9a312f61ca2d3349d5d0e89e9306bb817d60548

commit f9a312f61ca2d3349d5d0e89e9306bb817d60548
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-12-06 15:52:16 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-02-02 11:10:36 +0000

    linuxkpi: Fix style for dma_map_sgtable
    
    Reported by:    bz
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    
    (cherry picked from commit 72621b543e984a2074e1945adc26b49ac04af7e8)
---
 sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
index 25e4acf9e45d..afcaa69998b8 100644
--- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
@@ -357,15 +357,13 @@ dma_map_sgtable(struct device *dev, struct sg_table *sgt,
     enum dma_data_direction dir,
     unsigned long attrs)
 {
+	int nents;
 
-	int nents = dma_map_sg_attrs(dev, sgt->sgl, sgt->nents, dir, attrs);
-
-	if (nents < 0) {
-		return nents;
-	} else {
-		sgt->nents = nents;
-		return 0;
-	}
+	nents = dma_map_sg_attrs(dev, sgt->sgl, sgt->nents, dir, attrs);
+	if (nents < 0)
+		return (nents);
+	sgt->nents = nents;
+	return (0);
 }
 
 static inline void



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