All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Mauro Carvalho Chehab
	<mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hans Verkuil
	<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Tiffany Lin <tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	pochun lin <pochun.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches
Date: Wed, 13 Jul 2016 15:17:17 +0200	[thread overview]
Message-ID: <9022784.B8ChAA686D@wuerfel> (raw)
In-Reply-To: <1468407163.3555.1.camel@mtksdaap41>

On Wednesday, July 13, 2016 6:52:43 PM CEST pochun lin wrote:
> > diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > index f4e18bb44cb9..9a600525b3c1 100644
> > --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > @@ -295,9 +295,9 @@ static int h264_enc_alloc_work_buf(struct venc_h264_inst *inst)
> >               wb[i].iova = inst->work_bufs[i].dma_addr;
> >  
> >               mtk_vcodec_debug(inst,
> > -                              "work_buf[%d] va=0x%p iova=0x%p size=%zu",
> > +                              "work_buf[%d] va=0x%p iova=%pad size=%zu",
> >                                i, inst->work_bufs[i].va,
> > -                              (void *)inst->work_bufs[i].dma_addr,
> > +                              &inst->work_bufs[i].dma_addr,
> >                                inst->work_bufs[i].size);
> >       }
> >  
> 
> This modified will dump dma_addr's address, not dma_addr value.
> In actually, we need to dump dma_addr value.

According to Documentation/printk-formats.txt, it gets passed by
reference:

| DMA addresses types dma_addr_t:
|
|        %pad    0x01234567 or 0x0123456789abcdef
|
|        For printing a dma_addr_t type which can vary based on build options,
|        regardless of the width of the CPU data path. Passed by reference.

The whole point of the %pad/%pr/%pM/... format strings is to print
something that cannot be passed by value because the type is not
a fixed-size integer.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] [media] mtk-vcodec: fix more type mismatches
Date: Wed, 13 Jul 2016 15:17:17 +0200	[thread overview]
Message-ID: <9022784.B8ChAA686D@wuerfel> (raw)
In-Reply-To: <1468407163.3555.1.camel@mtksdaap41>

On Wednesday, July 13, 2016 6:52:43 PM CEST pochun lin wrote:
> > diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > index f4e18bb44cb9..9a600525b3c1 100644
> > --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > @@ -295,9 +295,9 @@ static int h264_enc_alloc_work_buf(struct venc_h264_inst *inst)
> >               wb[i].iova = inst->work_bufs[i].dma_addr;
> >  
> >               mtk_vcodec_debug(inst,
> > -                              "work_buf[%d] va=0x%p iova=0x%p size=%zu",
> > +                              "work_buf[%d] va=0x%p iova=%pad size=%zu",
> >                                i, inst->work_bufs[i].va,
> > -                              (void *)inst->work_bufs[i].dma_addr,
> > +                              &inst->work_bufs[i].dma_addr,
> >                                inst->work_bufs[i].size);
> >       }
> >  
> 
> This modified will dump dma_addr's address, not dma_addr value.
> In actually, we need to dump dma_addr value.

According to Documentation/printk-formats.txt, it gets passed by
reference:

| DMA addresses types dma_addr_t:
|
|        %pad    0x01234567 or 0x0123456789abcdef
|
|        For printing a dma_addr_t type which can vary based on build options,
|        regardless of the width of the CPU data path. Passed by reference.

The whole point of the %pad/%pr/%pM/... format strings is to print
something that cannot be passed by value because the type is not
a fixed-size integer.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: pochun lin <pochun.lin@mediatek.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	linux-kernel@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.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 v2] [media] mtk-vcodec: fix more type mismatches
Date: Wed, 13 Jul 2016 15:17:17 +0200	[thread overview]
Message-ID: <9022784.B8ChAA686D@wuerfel> (raw)
In-Reply-To: <1468407163.3555.1.camel@mtksdaap41>

On Wednesday, July 13, 2016 6:52:43 PM CEST pochun lin wrote:
> > diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > index f4e18bb44cb9..9a600525b3c1 100644
> > --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c
> > @@ -295,9 +295,9 @@ static int h264_enc_alloc_work_buf(struct venc_h264_inst *inst)
> >               wb[i].iova = inst->work_bufs[i].dma_addr;
> >  
> >               mtk_vcodec_debug(inst,
> > -                              "work_buf[%d] va=0x%p iova=0x%p size=%zu",
> > +                              "work_buf[%d] va=0x%p iova=%pad size=%zu",
> >                                i, inst->work_bufs[i].va,
> > -                              (void *)inst->work_bufs[i].dma_addr,
> > +                              &inst->work_bufs[i].dma_addr,
> >                                inst->work_bufs[i].size);
> >       }
> >  
> 
> This modified will dump dma_addr's address, not dma_addr value.
> In actually, we need to dump dma_addr value.

According to Documentation/printk-formats.txt, it gets passed by
reference:

| DMA addresses types dma_addr_t:
|
|        %pad    0x01234567 or 0x0123456789abcdef
|
|        For printing a dma_addr_t type which can vary based on build options,
|        regardless of the width of the CPU data path. Passed by reference.

The whole point of the %pad/%pr/%pM/... format strings is to print
something that cannot be passed by value because the type is not
a fixed-size integer.

	Arnd

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13  8:47 [PATCH v2] [media] mtk-vcodec: fix more type mismatches Arnd Bergmann
2016-07-13  8:47 ` Arnd Bergmann
2016-07-13  8:47 ` Arnd Bergmann
2016-07-13 10:52 ` pochun lin
2016-07-13 10:52   ` pochun lin
2016-07-13 10:52   ` pochun lin
2016-07-13 13:17   ` Arnd Bergmann [this message]
2016-07-13 13:17     ` Arnd Bergmann
2016-07-13 13:17     ` Arnd Bergmann
2016-07-13 13:22     ` pochun lin
2016-07-13 13:22       ` pochun lin
2016-07-13 13:22       ` pochun 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=9022784.B8ChAA686D@wuerfel \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=pochun.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@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 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.