From: Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 2/4] include/linux/ascii85: Update ascii85_encode()
Date: Tue, 20 Nov 2018 17:07:29 +0530 [thread overview]
Message-ID: <1542713851-14375-2-git-send-email-smasetty@codeaurora.org> (raw)
In-Reply-To: <1542713851-14375-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
The current implementation of ascii85_encode() does not copy the encoded
buffer 'z' to the output buffer in case the input is zero. This patch
simply adds this missing piece. This makes it easier to use this
function to encode large buffers.
Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
---
include/linux/ascii85.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/ascii85.h b/include/linux/ascii85.h
index 4cc4020..00646fc 100644
--- a/include/linux/ascii85.h
+++ b/include/linux/ascii85.h
@@ -23,8 +23,12 @@
{
int i;
- if (in == 0)
- return "z";
+ if (in == 0) {
+ out[0] = 'z';
+ out[1] = '\0';
+
+ return out;
+ }
out[5] = '\0';
for (i = 5; i--; ) {
--
1.9.1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-11-20 11:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 11:37 [PATCH 1/4] drm/msm: use kvmalloc for ring data in gpu crashstate Sharat Masetty
2018-11-20 11:37 ` [PATCH 4/4] drm/msm: Optimize adreno_show_object() Sharat Masetty
[not found] ` <1542713851-14375-4-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-20 15:56 ` Jordan Crouse
[not found] ` <1542713851-14375-1-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-20 11:37 ` Sharat Masetty [this message]
[not found] ` <1542713851-14375-2-git-send-email-smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-20 15:47 ` [PATCH 2/4] include/linux/ascii85: Update ascii85_encode() Jordan Crouse
2018-11-20 11:37 ` [PATCH 3/4] drm/msm: Use msm_gpu_state_bo for ringbuffer data Sharat Masetty
2018-11-20 15:52 ` Jordan Crouse
2018-11-20 15:42 ` [PATCH 1/4] drm/msm: use kvmalloc for ring data in gpu crashstate Jordan Crouse
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=1542713851-14375-2-git-send-email-smasetty@codeaurora.org \
--to=smasetty-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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