From: Dan Carpenter <dan.carpenter@oracle.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Stephen Boyd <swboyd@chromium.org>,
Abhinav Kumar <abhinavk@codeaurora.org>,
Lee Jones <lee.jones@linaro.org>,
Jeykumar Sankaran <jsanka@codeaurora.org>,
Archit Taneja <architt@codeaurora.org>,
Jordan Crouse <jordan@cosmicpenguin.net>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/msm/disp: fix endian bug in debugfs code
Date: Tue, 5 Oct 2021 09:00:33 +0300 [thread overview]
Message-ID: <20211005060033.GV2048@kadam> (raw)
In-Reply-To: <ab7f1f10-f366-40c1-436d-d7ebe15c7a9f@linaro.org>
On Tue, Oct 05, 2021 at 02:31:12AM +0300, Dmitry Baryshkov wrote:
> On 04/10/2021 16:47, Dan Carpenter wrote:
> > The "vbif->features" is type unsigned long but the debugfs file
> > is treating it as a u32 type. This will work in little endian
> > systems, but the correct thing is to change the debugfs to use
> > an unsigned long.
> >
> > Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > You might wonder why this code has so many casts. It's required because
> > this data is const. Which is fine because the file is read only.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
> > index 21d20373eb8b..e645a886e3c6 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
> > @@ -305,8 +305,8 @@ void dpu_debugfs_vbif_init(struct dpu_kms *dpu_kms, struct dentry *debugfs_root)
> > debugfs_vbif = debugfs_create_dir(vbif_name, entry);
> > - debugfs_create_u32("features", 0600, debugfs_vbif,
> > - (u32 *)&vbif->features);
> > + debugfs_create_ulong("features", 0600, debugfs_vbif,
> > + (unsigned long *)&vbif->features);
>
> As you are converting this to the ulong file, could you please also remove
> the now-unnecessary type cast?
I wanted to remove all the casting but they are required because of the
const.
regards,
dan carpenter
next prev parent reply other threads:[~2021-10-05 6:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 13:47 [PATCH] drm/msm/disp: fix endian bug in debugfs code Dan Carpenter
2021-10-04 23:31 ` Dmitry Baryshkov
2021-10-05 6:00 ` Dan Carpenter [this message]
2021-10-04 23:32 ` abhinavk
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=20211005060033.GV2048@kadam \
--to=dan.carpenter@oracle.com \
--cc=abhinavk@codeaurora.org \
--cc=airlied@linux.ie \
--cc=architt@codeaurora.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jordan@cosmicpenguin.net \
--cc=jsanka@codeaurora.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.