All of lore.kernel.org
 help / color / mirror / Atom feed
From: <wang.yi59@zte.com.cn>
To: steven.price@arm.com
Cc: tomeu.vizoso@collabora.com, wang.liang82@zte.com.cn,
	airlied@linux.ie, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, xue.zhihong@zte.com.cn,
	up2wing@gmail.com
Subject: Re:[PATCH v3] drm/panfrost: fix -Wmissing-prototypes warnings
Date: Mon, 28 Oct 2019 17:27:33 +0800 (CST)	[thread overview]
Message-ID: <201910281727338249544@zte.com.cn> (raw)
In-Reply-To: <31dc2f01-299c-6a52-4111-3e60e555cb9b@arm.com>


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

Hi Steve,

Thanks a lot for your time and patience :)

> On 25/10/2019 02:30, Yi Wang wrote:
> > We get these warnings when build kernel W=1:
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:35:6: warning: no previous prototype for ‘panfrost_perfcnt_clean_cache_done’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:40:6: warning: no previous prototype for ‘panfrost_perfcnt_sample_done’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:190:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_enable’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:218:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_dump’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:250:6: warning: no previous prototype for ‘panfrost_perfcnt_close’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:264:5: warning: no previous prototype for ‘panfrost_perfcnt_init’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:320:6: warning: no previous prototype for ‘panfrost_perfcnt_fini’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_mmu.c:227:6: warning: no previous prototype for ‘panfrost_mmu_flush_range’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_mmu.c:435:5: warning: no previous prototype for ‘panfrost_mmu_map_fault_addr’ [-Wmissing-prototypes]
> >
> > For file panfrost_mmu.c, make functions static to fix this.
> > For file panfrost_perfcnt.c, include header file can fix this.
> >
> > Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> > Reviewed-by: Steven Price <steven.price@arm.com>
> > ---
> >
> > v3: using tab size of 8 other than 4.
> >
> > v2: align parameter line and modify comment. Thanks to Steve.
> > ---
> >  drivers/gpu/drm/panfrost/panfrost_mmu.c     | 9 +++++----
> >  drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 1 +
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > index bdd9905..871574c 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > @@ -224,9 +224,9 @@ static size_t get_pgsize(u64 addr, size_t size)
> >      return SZ_2M;
> >  }
> >
> > -void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> > -                  struct panfrost_mmu *mmu,
> > -                  u64 iova, size_t size)
> > +static void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> > +                    struct panfrost_mmu *mmu,
> > +                    u64 iova, size_t size)
>
> Ok, I'll admit I wouldn't have spotted this unless I'd double checked by
> applying the patch, but you still seem to have something misconfigured
> in your editor. This is out by one character:
>
> static void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> >------->------->------->-------    struct panfrost_mmu *mmu,
> >------->------->------->-------    u64 iova, size_t size)
>
> There should be an extra space to align correctly.

According to [Linux kernel coding style](https://www.kernel.org/doc/html/v4.10/process/coding-style.html):
> Outside of comments, documentation and except in Kconfig, spaces are
> never used for indentation, and the above example is deliberately broken.

If I understand corretly, the tab is enough for indentation :-)

>
> >  {
> >      if (mmu->as < 0)
> >          return;
> > @@ -432,7 +432,8 @@ void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv)
> >
> >  #define NUM_FAULT_PAGES (SZ_2M / PAGE_SIZE)
> >
> > -int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, u64 addr)
> > +static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
> > +                    u64 addr)
>
> Here you're off-by-one in the other direction - you need to replace the
> final tab with 7 spaces:
>
> static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
> >------->------->------->------->-------u64 addr)
>
> Sorry to nit-pick over this, but it's good to get your editor setup
> correctly to ensure your formatting is correct.

Yeah, it worth time on the editor setup, and thanks again.

>
> Thanks,
>
> Steve


---
Best wishes
Yi Wang

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: <wang.yi59@zte.com.cn>
To: <steven.price@arm.com>
Cc: tomeu.vizoso@collabora.com, wang.liang82@zte.com.cn,
	airlied@linux.ie, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, xue.zhihong@zte.com.cn,
	up2wing@gmail.com
Subject: Re:[PATCH v3] drm/panfrost: fix -Wmissing-prototypes warnings
Date: Mon, 28 Oct 2019 17:27:33 +0800 (CST)	[thread overview]
Message-ID: <201910281727338249544@zte.com.cn> (raw)
Message-ID: <20191028092733.zYLW6lRS6Jr0yfcSgUTH-h2jtb7hm8eZmZm6DfN7eTI@z> (raw)
In-Reply-To: <31dc2f01-299c-6a52-4111-3e60e555cb9b@arm.com>


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

Hi Steve,

Thanks a lot for your time and patience :)

> On 25/10/2019 02:30, Yi Wang wrote:
> > We get these warnings when build kernel W=1:
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:35:6: warning: no previous prototype for ‘panfrost_perfcnt_clean_cache_done’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:40:6: warning: no previous prototype for ‘panfrost_perfcnt_sample_done’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:190:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_enable’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:218:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_dump’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:250:6: warning: no previous prototype for ‘panfrost_perfcnt_close’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:264:5: warning: no previous prototype for ‘panfrost_perfcnt_init’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_perfcnt.c:320:6: warning: no previous prototype for ‘panfrost_perfcnt_fini’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_mmu.c:227:6: warning: no previous prototype for ‘panfrost_mmu_flush_range’ [-Wmissing-prototypes]
> > drivers/gpu/drm/panfrost/panfrost_mmu.c:435:5: warning: no previous prototype for ‘panfrost_mmu_map_fault_addr’ [-Wmissing-prototypes]
> >
> > For file panfrost_mmu.c, make functions static to fix this.
> > For file panfrost_perfcnt.c, include header file can fix this.
> >
> > Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> > Reviewed-by: Steven Price <steven.price@arm.com>
> > ---
> >
> > v3: using tab size of 8 other than 4.
> >
> > v2: align parameter line and modify comment. Thanks to Steve.
> > ---
> >  drivers/gpu/drm/panfrost/panfrost_mmu.c     | 9 +++++----
> >  drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 1 +
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > index bdd9905..871574c 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> > @@ -224,9 +224,9 @@ static size_t get_pgsize(u64 addr, size_t size)
> >      return SZ_2M;
> >  }
> >
> > -void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> > -                  struct panfrost_mmu *mmu,
> > -                  u64 iova, size_t size)
> > +static void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> > +                    struct panfrost_mmu *mmu,
> > +                    u64 iova, size_t size)
>
> Ok, I'll admit I wouldn't have spotted this unless I'd double checked by
> applying the patch, but you still seem to have something misconfigured
> in your editor. This is out by one character:
>
> static void panfrost_mmu_flush_range(struct panfrost_device *pfdev,
> >------->------->------->-------    struct panfrost_mmu *mmu,
> >------->------->------->-------    u64 iova, size_t size)
>
> There should be an extra space to align correctly.

According to [Linux kernel coding style](https://www.kernel.org/doc/html/v4.10/process/coding-style.html):
> Outside of comments, documentation and except in Kconfig, spaces are
> never used for indentation, and the above example is deliberately broken.

If I understand corretly, the tab is enough for indentation :-)

>
> >  {
> >      if (mmu->as < 0)
> >          return;
> > @@ -432,7 +432,8 @@ void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv)
> >
> >  #define NUM_FAULT_PAGES (SZ_2M / PAGE_SIZE)
> >
> > -int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, u64 addr)
> > +static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
> > +                    u64 addr)
>
> Here you're off-by-one in the other direction - you need to replace the
> final tab with 7 spaces:
>
> static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
> >------->------->------->------->-------u64 addr)
>
> Sorry to nit-pick over this, but it's good to get your editor setup
> correctly to ensure your formatting is correct.

Yeah, it worth time on the editor setup, and thanks again.

>
> Thanks,
>
> Steve


---
Best wishes
Yi Wang

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-10-28  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  1:30 [PATCH v3] drm/panfrost: fix -Wmissing-prototypes warnings Yi Wang
2019-10-25  1:30 ` Yi Wang
2019-10-25  9:10 ` Steven Price
2019-10-25  9:10   ` Steven Price
2019-10-28  9:27   ` wang.yi59 [this message]
2019-10-28  9:27     ` wang.yi59
2019-10-28 13:52     ` [PATCH " Steven Price
2019-10-28 13:52       ` Steven Price
2019-10-29  1:46       ` wang.yi59
2019-10-29  1:46         ` wang.yi59

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=201910281727338249544@zte.com.cn \
    --to=wang.yi59@zte.com.cn \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=up2wing@gmail.com \
    --cc=wang.liang82@zte.com.cn \
    --cc=xue.zhihong@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 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.