Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442457

Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches
Date 2016-07-13 15:30 +0200
Message-ID <rUsoG-3Co-25@gated-at.bofh.it> (permalink)
References <rUobo-D9-15@gated-at.bofh.it> <rUq3v-1YL-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] [media] mtk-vcodec: fix more type mismatches Arnd Bergmann <arnd@arndb.de> - 2016-07-13 11:00 +0200
  Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches pochun lin <pochun.lin@mediatek.com> - 2016-07-13 13:00 +0200
    Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches Arnd Bergmann <arnd@arndb.de> - 2016-07-13 15:30 +0200
      Re: [PATCH v2] [media] mtk-vcodec: fix more type mismatches pochun lin <pochun.lin@mediatek.com> - 2016-07-13 15:30 +0200

csiph-web