Backports Archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: backports@vger.kernel.org
Cc: john@phrozen.org
Subject: [PATCH] backports: backport sg_init_marker()
Date: Thu,  6 Sep 2018 13:30:02 +0200	[thread overview]
Message-ID: <20180906113002.59425-1-nbd@nbd.name> (raw)

It is used by new mt76 changes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/scatterlist.h | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h
index bfc74494..06934b6b 100644
--- a/backport/backport-include/linux/scatterlist.h
+++ b/backport/backport-include/linux/scatterlist.h
@@ -102,4 +102,27 @@ size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
 
 #endif /* LINUX_VERSION_IS_LESS(3, 11, 0) */
 
+#if LINUX_VERSION_IS_LESS(4, 17, 0)
+
+#define sg_init_marker LINUX_BACKPORT(sg_init_marker)
+/**
+ * sg_init_marker - Initialize markers in sg table
+ * @sgl:	   The SG table
+ * @nents:	   Number of entries in table
+ *
+ **/
+static inline void sg_init_marker(struct scatterlist *sgl,
+				  unsigned int nents)
+{
+#ifdef CONFIG_DEBUG_SG
+	unsigned int i;
+
+	for (i = 0; i < nents; i++)
+		sgl[i].sg_magic = SG_MAGIC;
+#endif
+	sg_mark_end(&sgl[nents - 1]);
+}
+
+#endif /* LINUX_VERSION_IS_LESS(4, 17, 0) */
+
 #endif /* __BACKPORT_SCATTERLIST_H */
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

                 reply	other threads:[~2018-09-06 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180906113002.59425-1-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=backports@vger.kernel.org \
    --cc=john@phrozen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).