Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Dec 2022 15:52:59 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 72621b543e98 - main - linuxkpi: Fix style for dma_map_sgtable
Message-ID:  <202212061552.2B6Fqxhb033686@gitrepo.freebsd.org>

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

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

commit 72621b543e984a2074e1945adc26b49ac04af7e8
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-12-06 15:52:16 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-12-06 15:52:16 +0000

    linuxkpi: Fix style for dma_map_sgtable
    
    Reported by:    bz
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
---
 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 7f2579787b4b..01395cc7a0d5 100644
--- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h
@@ -361,15 +361,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?202212061552.2B6Fqxhb033686>