mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Edward O'Callaghan" <funfunctor@folklore1984.net>
To: Baoyou Xie <baoyou.xie@linaro.org>
Cc: alexander.deucher@amd.com, christian.koenig@amd.com,
	Dave Airlie <airlied@linux.ie>,
	Rex.Zhu@amd.com, Jammy.Zhou@amd.com,
	elfring@users.sourceforge.net, ray.huang@amd.com,
	Young.Yang@amd.com, airlied@redhat.com, Mykola.Lysenko@amd.com,
	dan.carpenter@oracle.com, David1.Zhou@amd.com, Monk.Liu@amd.com,
	Jerry.Zhang@amd.com, samuel.li@amd.com, tom.stdenis@amd.com,
	Flora.Cui@amd.com, JinHuiEric.Huang@amd.com,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	xie.baoyou@zte.com.cn
Subject: Re: [PATCH] drm: amdgpu: mark symbols static where possible
Date: Sat, 3 Sep 2016 16:44:39 +1000	[thread overview]
Message-ID: <afe518d5-cfea-304b-47d2-a65aeaf95f68@folklore1984.net> (raw)
In-Reply-To: <CA+DQWkyb7xV_9o7dE4rfiy33=8_q5sfpWoTgbW8zig3f2FAoMQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 9042 bytes --]



On 09/03/2016 04:23 PM, Baoyou Xie wrote:
> in drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c and
> drivers/gpu/drm/amd/amdgpu/cz_smc.c, there are two functions named
> cz_write_smc_sram_dword, but these two functions only have the same
> name, but in fact they are different functions, even their declarations
> is different.

Are you sure? Because apart from the crazy macro chain they look like
they wind up being the same to me.

> 
> On 3 September 2016 at 14:11, Edward O'Callaghan
> <funfunctor@folklore1984.net <mailto:funfunctor@folklore1984.net>> wrote:
> 
>     Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net
>     <mailto:funfunctor@folklore1984.net>>
> 
>     Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken
>     they seems identical in both:
>       drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c  and,
>       drivers/gpu/drm/amd/amdgpu/cz_smc.c
>     with a personal preference to the powerplay version I suppose.
> 
>     Similar story with cz_send_msg_to_smc_async() *I think* but the
>     powerplay one uses some insane macro chain that dispatches to some
>     function called smum_wait_for_register_unequal(), quite hard to follow..
> 
>     Any way, that is out of scope of the patch here.
> 
>     Kind Regards,
>     Edward.
> 
>     On 09/03/2016 03:57 PM, Baoyou Xie wrote:
>     > We get a few warnings when building kernel with W=1:
>     > drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous
>     prototype for 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
>     > drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous
>     prototype for 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
>     > drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no
>     previous prototype for 'iceland_start_smc' [-Wmissing-prototypes]
>     > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous
>     prototype for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
>     > drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous
>     prototype for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
>     > ....
>     >
>     > In fact, these functions are only used in the file in which they are
>     > declared and don't need a declaration, but can be made static.
>     > So this patch marks these functions with 'static'.
>     >
>     > Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org
>     <mailto:baoyou.xie@linaro.org>>
>     > ---
>     >  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
>     >  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
>     >  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
>     >  drivers/gpu/drm/amd/amdgpu/cz_smc.c      | 4 ++--
>     >  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c    | 2 +-
>     >  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 ++++----
>     >  6 files changed, 11 insertions(+), 11 deletions(-)
>     >
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
>     b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
>     > index bc0440f..a831218 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
>     > @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct
>     cgs_device *cgs_device, unsigned src_id, un
>     >       return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
>     >  }
>     >
>     > -int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
>     > +static int amdgpu_cgs_set_clockgating_state(struct cgs_device
>     *cgs_device,
>     >                                 enum amd_ip_block_type block_type,
>     >                                 enum amd_clockgating_state state)
>     >  {
>     > @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct
>     cgs_device *cgs_device,
>     >       return r;
>     >  }
>     >
>     > -int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
>     > +static int amdgpu_cgs_set_powergating_state(struct cgs_device
>     *cgs_device,
>     >                                 enum amd_ip_block_type block_type,
>     >                                 enum amd_powergating_state state)
>     >  {
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>     b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>     > index 0307ff5..f65bdaf 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>     > @@ -287,7 +287,7 @@ static u64
>     amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev)
>     >       return max(bytes_moved_threshold, 1024*1024ull);
>     >  }
>     >
>     > -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>     > +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>     >                           struct list_head *validated)
>     >  {
>     >       struct amdgpu_bo_list_entry *lobj;
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>     b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>     > index 6674d40..31bfe3a 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
>     > @@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job
>     *job)
>     >               amdgpu_ib_free(job->adev, &job->ibs[i], f);
>     >  }
>     >
>     > -void amdgpu_job_free_cb(struct amd_sched_job *s_job)
>     > +static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
>     >  {
>     >       struct amdgpu_job *job = container_of(s_job, struct
>     amdgpu_job, base);
>     >
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
>     b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
>     > index ac7fee7..c80c2e9 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
>     > @@ -48,7 +48,7 @@ static struct cz_smu_private_data
>     *cz_smu_get_priv(struct amdgpu_device *adev)
>     >       return priv;
>     >  }
>     >
>     > -int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
>     > +static int cz_send_msg_to_smc_async(struct amdgpu_device *adev,
>     u16 msg)
>     >  {
>     >       int i;
>     >       u32 content = 0, tmp;
>     > @@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct
>     amdgpu_device *adev, u32 smc_address,
>     >       return 0;
>     >  }
>     >
>     > -int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32
>     smc_address,
>     > +static int cz_write_smc_sram_dword(struct amdgpu_device *adev,
>     u32 smc_address,
>     >                                               u32 value, u32 limit)
>     >  {
>     >       int ret;
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>     b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>     > index bff8668..6997f7c 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>     > @@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct
>     amdgpu_device *adev)
>     >       }
>     >  }
>     >
>     > -void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
>     > +static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
>     >  {
>     >       u32 tmp = RREG32(mmRLC_CNTL);
>     >
>     > diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
>     b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
>     > index 2118399..ef7c27d 100644
>     > --- a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
>     > +++ b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
>     > @@ -121,7 +121,7 @@ out:
>     >       return result;
>     >  }
>     >
>     > -void iceland_start_smc(struct amdgpu_device *adev)
>     > +static void iceland_start_smc(struct amdgpu_device *adev)
>     >  {
>     >       uint32_t val = RREG32_SMC(ixSMC_SYSCON_RESET_CNTL);
>     >
>     > @@ -129,7 +129,7 @@ void iceland_start_smc(struct amdgpu_device *adev)
>     >       WREG32_SMC(ixSMC_SYSCON_RESET_CNTL, val);
>     >  }
>     >
>     > -void iceland_reset_smc(struct amdgpu_device *adev)
>     > +static void iceland_reset_smc(struct amdgpu_device *adev)
>     >  {
>     >       uint32_t val = RREG32_SMC(ixSMC_SYSCON_RESET_CNTL);
>     >
>     > @@ -145,7 +145,7 @@ static int
>     iceland_program_jump_on_start(struct amdgpu_device *adev)
>     >       return 0;
>     >  }
>     >
>     > -void iceland_stop_smc_clock(struct amdgpu_device *adev)
>     > +static void iceland_stop_smc_clock(struct amdgpu_device *adev)
>     >  {
>     >       uint32_t val = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0);
>     >
>     > @@ -153,7 +153,7 @@ void iceland_stop_smc_clock(struct
>     amdgpu_device *adev)
>     >       WREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0, val);
>     >  }
>     >
>     > -void iceland_start_smc_clock(struct amdgpu_device *adev)
>     > +static void iceland_start_smc_clock(struct amdgpu_device *adev)
>     >  {
>     >       uint32_t val = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0);
>     >
>     >
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-09-03  6:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-03  5:57 Baoyou Xie
2016-09-03  6:11 ` Edward O'Callaghan
     [not found]   ` <CA+DQWkyb7xV_9o7dE4rfiy33=8_q5sfpWoTgbW8zig3f2FAoMQ@mail.gmail.com>
2016-09-03  6:44     ` Edward O'Callaghan [this message]
2016-09-03  8:12 ` Christian König
2016-09-03  9:10 ` Huang Rui

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=afe518d5-cfea-304b-47d2-a65aeaf95f68@folklore1984.net \
    --to=funfunctor@folklore1984.net \
    --cc=David1.Zhou@amd.com \
    --cc=Flora.Cui@amd.com \
    --cc=Jammy.Zhou@amd.com \
    --cc=Jerry.Zhang@amd.com \
    --cc=JinHuiEric.Huang@amd.com \
    --cc=Monk.Liu@amd.com \
    --cc=Mykola.Lysenko@amd.com \
    --cc=Rex.Zhu@amd.com \
    --cc=Young.Yang@amd.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=arnd@arndb.de \
    --cc=baoyou.xie@linaro.org \
    --cc=christian.koenig@amd.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=elfring@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray.huang@amd.com \
    --cc=samuel.li@amd.com \
    --cc=tom.stdenis@amd.com \
    --cc=xie.baoyou@zte.com.cn \
    /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

all inboxes | Powered by JetHome®