linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: tiffany lin <tiffany.lin@mediatek.com>,
	linux-kernel@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	PoChun Lin <pochun.lin@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-mediatek@lists.infradead.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] [media] mtk-vcodec: fix type mismatches
Date: Wed, 13 Jul 2016 15:08:09 +0200	[thread overview]
Message-ID: <4915511.9pXBipIRF8@wuerfel> (raw)
In-Reply-To: <1468403786.32454.16.camel@mtksdaap41>

On Wednesday, July 13, 2016 5:56:26 PM CEST tiffany lin wrote:
> > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > index 6dcae0a0a1f2..0b25a8700877 100644
> > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> > @@ -1028,15 +1028,15 @@ static void mtk_venc_worker(struct work_struct *work)
> >       bs_buf.size = (size_t)dst_buf->planes[0].length;
> >  
> >       mtk_v4l2_debug(2,
> > -                     "Framebuf VA=%p PA=%llx Size=0x%lx;VA=%p PA=0x%llx Size=0x%lx;VA=%p PA=0x%llx Size=%zu",
> > +                     "Framebuf VA=%p PA=%pad Size=0x%zx;VA=%p PA=%pad Size=0x%zx;VA=%p PA=%pad Size=0x%zx",
> >                       frm_buf.fb_addr[0].va,
> > -                     (u64)frm_buf.fb_addr[0].dma_addr,
> > +                     &frm_buf.fb_addr[0].dma_addr,
> >                       frm_buf.fb_addr[0].size,
> >                       frm_buf.fb_addr[1].va,
> > -                     (u64)frm_buf.fb_addr[1].dma_addr,
> > +                     &frm_buf.fb_addr[1].dma_addr,
> >                       frm_buf.fb_addr[1].size,
> >                       frm_buf.fb_addr[2].va,
> > -                     (u64)frm_buf.fb_addr[2].dma_addr,
> > +                     &frm_buf.fb_addr[2].dma_addr,
> >                       frm_buf.fb_addr[2].size);
> This change will make debug message dump address of dma_addr field but
> not the value of the dma_addr we want.
> How about change it from
> PA=%llx -> PA=%u
> (u64)frm_buf.fb_addr[0].dma_addr -> (u32)frm_buf.fb_addr[0].dma_addr,
> 

The %llx works fine with the cast to u64, the change above is mainly for the "%lx"
on a size_t causing a warning.

The change to %pad is done in order to use a consistent output for the
dma_addr_t, which had a leading "0x" in two cases but not in the first
one.

printk interprets %pad as a pointer to a dma_addr_t and prints the
address, not the pointer to it, see Documentation/printk-formats.txt,
which lets you avoid the type cast as well as the 0x.

	Arnd

  reply	other threads:[~2016-07-13 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 21:37 [PATCH] [media] mtk-vcodec: fix type mismatches Arnd Bergmann
2016-07-13  9:56 ` tiffany lin
2016-07-13 13:08   ` Arnd Bergmann [this message]
2016-07-13 13:55     ` tiffany lin
2016-07-14  7:34 ` tiffany lin

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=4915511.9pXBipIRF8@wuerfel \
    --to=arnd@arndb.de \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=pochun.lin@mediatek.com \
    --cc=tiffany.lin@mediatek.com \
    /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 NNTP newsgroup(s).