All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
@ 2023-03-24 19:54 ` Tom Rix
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rix @ 2023-03-24 19:54 UTC (permalink / raw)
  To: zackr, linux-graphics-maintainer, airlied, daniel, nathan, ndesaulniers
  Cc: dri-devel, linux-kernel, llvm, Tom Rix

clang with W=1 reports
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
  'mksstat_init_record' [-Werror,-Wunused-function]
static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
                    ^
This function is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index e76976a95a1e..ca1a3fe44fa5 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -702,32 +702,6 @@ static inline void hypervisor_ppn_remove(PPN64 pfn)
 /* Header to the text description of mksGuestStat instance descriptor */
 #define MKSSTAT_KERNEL_DESCRIPTION "vmwgfx"
 
-/**
- * mksstat_init_record: Initializes an MKSGuestStatCounter-based record
- * for the respective mksGuestStat index.
- *
- * @stat_idx: Index of the MKSGuestStatCounter-based mksGuestStat record.
- * @pstat: Pointer to array of MKSGuestStatCounterTime.
- * @pinfo: Pointer to array of MKSGuestStatInfoEntry.
- * @pstrs: Pointer to current end of the name/description sequence.
- * Return: Pointer to the new end of the names/description sequence.
- */
-
-static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
-	MKSGuestStatCounterTime *pstat, MKSGuestStatInfoEntry *pinfo, char *pstrs)
-{
-	char *const pstrd = pstrs + strlen(mksstat_kern_name_desc[stat_idx][0]) + 1;
-	strcpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
-	strcpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
-
-	pinfo[stat_idx].name.s = pstrs;
-	pinfo[stat_idx].description.s = pstrd;
-	pinfo[stat_idx].flags = MKS_GUEST_STAT_FLAG_NONE;
-	pinfo[stat_idx].stat.counter = (MKSGuestStatCounter *)&pstat[stat_idx];
-
-	return pstrd + strlen(mksstat_kern_name_desc[stat_idx][1]) + 1;
-}
-
 /**
  * mksstat_init_record_time: Initializes an MKSGuestStatCounterTime-based record
  * for the respective mksGuestStat index.
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
@ 2023-03-24 19:54 ` Tom Rix
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rix @ 2023-03-24 19:54 UTC (permalink / raw)
  To: zackr, linux-graphics-maintainer, airlied, daniel, nathan, ndesaulniers
  Cc: Tom Rix, llvm, linux-kernel, dri-devel

clang with W=1 reports
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
  'mksstat_init_record' [-Werror,-Wunused-function]
static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
                    ^
This function is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index e76976a95a1e..ca1a3fe44fa5 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -702,32 +702,6 @@ static inline void hypervisor_ppn_remove(PPN64 pfn)
 /* Header to the text description of mksGuestStat instance descriptor */
 #define MKSSTAT_KERNEL_DESCRIPTION "vmwgfx"
 
-/**
- * mksstat_init_record: Initializes an MKSGuestStatCounter-based record
- * for the respective mksGuestStat index.
- *
- * @stat_idx: Index of the MKSGuestStatCounter-based mksGuestStat record.
- * @pstat: Pointer to array of MKSGuestStatCounterTime.
- * @pinfo: Pointer to array of MKSGuestStatInfoEntry.
- * @pstrs: Pointer to current end of the name/description sequence.
- * Return: Pointer to the new end of the names/description sequence.
- */
-
-static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
-	MKSGuestStatCounterTime *pstat, MKSGuestStatInfoEntry *pinfo, char *pstrs)
-{
-	char *const pstrd = pstrs + strlen(mksstat_kern_name_desc[stat_idx][0]) + 1;
-	strcpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
-	strcpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
-
-	pinfo[stat_idx].name.s = pstrs;
-	pinfo[stat_idx].description.s = pstrd;
-	pinfo[stat_idx].flags = MKS_GUEST_STAT_FLAG_NONE;
-	pinfo[stat_idx].stat.counter = (MKSGuestStatCounter *)&pstat[stat_idx];
-
-	return pstrd + strlen(mksstat_kern_name_desc[stat_idx][1]) + 1;
-}
-
 /**
  * mksstat_init_record_time: Initializes an MKSGuestStatCounterTime-based record
  * for the respective mksGuestStat index.
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
  2023-03-24 19:54 ` Tom Rix
@ 2023-04-07 17:49   ` Nick Desaulniers
  -1 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2023-04-07 17:49 UTC (permalink / raw)
  To: Tom Rix
  Cc: zackr, linux-graphics-maintainer, airlied, daniel, nathan,
	dri-devel, linux-kernel, llvm

On Fri, Mar 24, 2023 at 12:54 PM Tom Rix <trix@redhat.com> wrote:
>
> clang with W=1 reports
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
>   'mksstat_init_record' [-Werror,-Wunused-function]
> static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
>                     ^
> This function is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 26 --------------------------
>  1 file changed, 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> index e76976a95a1e..ca1a3fe44fa5 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> @@ -702,32 +702,6 @@ static inline void hypervisor_ppn_remove(PPN64 pfn)
>  /* Header to the text description of mksGuestStat instance descriptor */
>  #define MKSSTAT_KERNEL_DESCRIPTION "vmwgfx"
>
> -/**
> - * mksstat_init_record: Initializes an MKSGuestStatCounter-based record
> - * for the respective mksGuestStat index.
> - *
> - * @stat_idx: Index of the MKSGuestStatCounter-based mksGuestStat record.
> - * @pstat: Pointer to array of MKSGuestStatCounterTime.
> - * @pinfo: Pointer to array of MKSGuestStatInfoEntry.
> - * @pstrs: Pointer to current end of the name/description sequence.
> - * Return: Pointer to the new end of the names/description sequence.
> - */
> -
> -static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
> -       MKSGuestStatCounterTime *pstat, MKSGuestStatInfoEntry *pinfo, char *pstrs)
> -{
> -       char *const pstrd = pstrs + strlen(mksstat_kern_name_desc[stat_idx][0]) + 1;
> -       strcpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
> -       strcpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
> -
> -       pinfo[stat_idx].name.s = pstrs;
> -       pinfo[stat_idx].description.s = pstrd;
> -       pinfo[stat_idx].flags = MKS_GUEST_STAT_FLAG_NONE;

This was the last user of MKS_GUEST_STAT_FLAG_NONE, is there anything
else to clean up there?  Otherwise LGTM.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> -       pinfo[stat_idx].stat.counter = (MKSGuestStatCounter *)&pstat[stat_idx];
> -
> -       return pstrd + strlen(mksstat_kern_name_desc[stat_idx][1]) + 1;
> -}
> -
>  /**
>   * mksstat_init_record_time: Initializes an MKSGuestStatCounterTime-based record
>   * for the respective mksGuestStat index.
> --
> 2.27.0
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
@ 2023-04-07 17:49   ` Nick Desaulniers
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2023-04-07 17:49 UTC (permalink / raw)
  To: Tom Rix; +Cc: llvm, linux-kernel, dri-devel, nathan, linux-graphics-maintainer

On Fri, Mar 24, 2023 at 12:54 PM Tom Rix <trix@redhat.com> wrote:
>
> clang with W=1 reports
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
>   'mksstat_init_record' [-Werror,-Wunused-function]
> static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
>                     ^
> This function is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 26 --------------------------
>  1 file changed, 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> index e76976a95a1e..ca1a3fe44fa5 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> @@ -702,32 +702,6 @@ static inline void hypervisor_ppn_remove(PPN64 pfn)
>  /* Header to the text description of mksGuestStat instance descriptor */
>  #define MKSSTAT_KERNEL_DESCRIPTION "vmwgfx"
>
> -/**
> - * mksstat_init_record: Initializes an MKSGuestStatCounter-based record
> - * for the respective mksGuestStat index.
> - *
> - * @stat_idx: Index of the MKSGuestStatCounter-based mksGuestStat record.
> - * @pstat: Pointer to array of MKSGuestStatCounterTime.
> - * @pinfo: Pointer to array of MKSGuestStatInfoEntry.
> - * @pstrs: Pointer to current end of the name/description sequence.
> - * Return: Pointer to the new end of the names/description sequence.
> - */
> -
> -static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
> -       MKSGuestStatCounterTime *pstat, MKSGuestStatInfoEntry *pinfo, char *pstrs)
> -{
> -       char *const pstrd = pstrs + strlen(mksstat_kern_name_desc[stat_idx][0]) + 1;
> -       strcpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
> -       strcpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
> -
> -       pinfo[stat_idx].name.s = pstrs;
> -       pinfo[stat_idx].description.s = pstrd;
> -       pinfo[stat_idx].flags = MKS_GUEST_STAT_FLAG_NONE;

This was the last user of MKS_GUEST_STAT_FLAG_NONE, is there anything
else to clean up there?  Otherwise LGTM.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> -       pinfo[stat_idx].stat.counter = (MKSGuestStatCounter *)&pstat[stat_idx];
> -
> -       return pstrd + strlen(mksstat_kern_name_desc[stat_idx][1]) + 1;
> -}
> -
>  /**
>   * mksstat_init_record_time: Initializes an MKSGuestStatCounterTime-based record
>   * for the respective mksGuestStat index.
> --
> 2.27.0
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
  2023-03-24 19:54 ` Tom Rix
@ 2023-04-11 17:56   ` Zack Rusin
  -1 siblings, 0 replies; 6+ messages in thread
From: Zack Rusin @ 2023-04-11 17:56 UTC (permalink / raw)
  To: daniel, nathan, ndesaulniers, Linux-graphics-maintainer, trix, airlied
  Cc: dri-devel, llvm, linux-kernel

On Fri, 2023-03-24 at 15:54 -0400, Tom Rix wrote:
> clang with W=1 reports
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
>   'mksstat_init_record' [-Werror,-Wunused-function]
> static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
>                     ^
> This function is not used so remove it.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Thanks, Martin Krastev already sent the same patch to the dri-devel two weeks
before. It's in the drm-misc-next branch in the drm-misc tree and should migrate to
kernel for 6.4.

z


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/vmwgfx: remove unused mksstat_init_record function
@ 2023-04-11 17:56   ` Zack Rusin
  0 siblings, 0 replies; 6+ messages in thread
From: Zack Rusin @ 2023-04-11 17:56 UTC (permalink / raw)
  To: daniel, nathan, ndesaulniers, Linux-graphics-maintainer, trix, airlied
  Cc: llvm, linux-kernel, dri-devel

On Fri, 2023-03-24 at 15:54 -0400, Tom Rix wrote:
> clang with W=1 reports
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
>   'mksstat_init_record' [-Werror,-Wunused-function]
> static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
>                     ^
> This function is not used so remove it.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Thanks, Martin Krastev already sent the same patch to the dri-devel two weeks
before. It's in the drm-misc-next branch in the drm-misc tree and should migrate to
kernel for 6.4.

z


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-11 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 19:54 [PATCH] drm/vmwgfx: remove unused mksstat_init_record function Tom Rix
2023-03-24 19:54 ` Tom Rix
2023-04-07 17:49 ` Nick Desaulniers
2023-04-07 17:49   ` Nick Desaulniers
2023-04-11 17:56 ` Zack Rusin
2023-04-11 17:56   ` Zack Rusin

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.