llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: dlm: remove unused is_granted function
@ 2023-03-24 17:59 Tom Rix
  2023-04-07 17:44 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-03-24 17:59 UTC (permalink / raw)
  To: ccaulfie, teigland, nathan, ndesaulniers
  Cc: cluster-devel, linux-kernel, llvm, Tom Rix

clang with W=1 reports
fs/dlm/lock.c:239:19: error: unused function
  'is_granted' [-Werror,-Wunused-function]
static inline int is_granted(struct dlm_lkb *lkb)
                  ^
This function is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 fs/dlm/lock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 1582c8b1404c..b9c124b88f15 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -236,11 +236,6 @@ static inline int is_altmode(struct dlm_lkb *lkb)
 	return test_bit(DLM_SBF_ALTMODE_BIT, &lkb->lkb_sbflags);
 }
 
-static inline int is_granted(struct dlm_lkb *lkb)
-{
-	return (lkb->lkb_status == DLM_LKSTS_GRANTED);
-}
-
 static inline int is_remote(struct dlm_rsb *r)
 {
 	DLM_ASSERT(r->res_nodeid >= 0, dlm_print_rsb(r););
-- 
2.27.0


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

* Re: [PATCH] fs: dlm: remove unused is_granted function
  2023-03-24 17:59 [PATCH] fs: dlm: remove unused is_granted function Tom Rix
@ 2023-04-07 17:44 ` Nick Desaulniers
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2023-04-07 17:44 UTC (permalink / raw)
  To: Tom Rix; +Cc: ccaulfie, teigland, nathan, cluster-devel, linux-kernel, llvm

On Fri, Mar 24, 2023 at 10:59 AM Tom Rix <trix@redhat.com> wrote:
>
> clang with W=1 reports
> fs/dlm/lock.c:239:19: error: unused function
>   'is_granted' [-Werror,-Wunused-function]
> static inline int is_granted(struct dlm_lkb *lkb)
>                   ^
> This function is not used so remove it.

How about instead of remove it, we see if we can reuse it?
Grep for DLM_LKSTS_GRANTED. The comparisons on:

2668: if (lkb->lkb_status != DLM_LKSTS_GRANTED)
2787: if (lkb->lkb_status == DLM_LKSTS_GRANTED &&
3749: if (lkb->lkb_status != DLM_LKSTS_GRANTED)

all look like they ought to.


>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  fs/dlm/lock.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
> index 1582c8b1404c..b9c124b88f15 100644
> --- a/fs/dlm/lock.c
> +++ b/fs/dlm/lock.c
> @@ -236,11 +236,6 @@ static inline int is_altmode(struct dlm_lkb *lkb)
>         return test_bit(DLM_SBF_ALTMODE_BIT, &lkb->lkb_sbflags);
>  }
>
> -static inline int is_granted(struct dlm_lkb *lkb)
> -{
> -       return (lkb->lkb_status == DLM_LKSTS_GRANTED);
> -}
> -
>  static inline int is_remote(struct dlm_rsb *r)
>  {
>         DLM_ASSERT(r->res_nodeid >= 0, dlm_print_rsb(r););
> --
> 2.27.0
>


-- 
Thanks,
~Nick Desaulniers

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 17:59 [PATCH] fs: dlm: remove unused is_granted function Tom Rix
2023-04-07 17:44 ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).