All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugobjects: add missing empty function debug_object_active_state()
@ 2021-06-17  7:10 Xin He
  2021-06-19  5:03 ` Stephen Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Xin He @ 2021-06-17  7:10 UTC (permalink / raw)
  To: tglx, keescook, swboyd; +Cc: linux-kernel, Xin He

All other functions are defined for when CONFIG_DEBUG_OBJECTS
is not set.

Signed-off-by: Xin He <hexin.op@bytedance.com>
---
 include/linux/debugobjects.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 8d2dde23e9fb..af0d73d8d29b 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -99,6 +99,9 @@ static inline void
 debug_object_free      (void *addr, const struct debug_obj_descr *descr) { }
 static inline void
 debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) { }
+static inline void
+debug_object_active_state(void *addr, const struct debug_obj_descr *descr,
+			  unsigned int expect, unsigned int next) { }
 
 static inline void debug_objects_early_init(void) { }
 static inline void debug_objects_mem_init(void) { }
-- 
2.20.1


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

* Re: [PATCH] debugobjects: add missing empty function debug_object_active_state()
  2021-06-17  7:10 [PATCH] debugobjects: add missing empty function debug_object_active_state() Xin He
@ 2021-06-19  5:03 ` Stephen Boyd
  2021-06-19 16:47   ` Thomas Gleixner
  2021-06-20  5:40   ` 何鑫
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Boyd @ 2021-06-19  5:03 UTC (permalink / raw)
  To: Xin He, keescook, tglx; +Cc: linux-kernel

Quoting Xin He (2021-06-17 00:10:27)
> All other functions are defined for when CONFIG_DEBUG_OBJECTS
> is not set.
>
> Signed-off-by: Xin He <hexin.op@bytedance.com>
> ---
>  include/linux/debugobjects.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
> index 8d2dde23e9fb..af0d73d8d29b 100644
> --- a/include/linux/debugobjects.h
> +++ b/include/linux/debugobjects.h
> @@ -99,6 +99,9 @@ static inline void
>  debug_object_free      (void *addr, const struct debug_obj_descr *descr) { }
>  static inline void
>  debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) { }
> +static inline void
> +debug_object_active_state(void *addr, const struct debug_obj_descr *descr,
> +                         unsigned int expect, unsigned int next) { }

I suppose it's a landmine that may go off at some point, but this isn't
fixing anything that's broken at the moment, correct?

>
>  static inline void debug_objects_early_init(void) { }
>  static inline void debug_objects_mem_init(void) { }

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

* Re: [PATCH] debugobjects: add missing empty function debug_object_active_state()
  2021-06-19  5:03 ` Stephen Boyd
@ 2021-06-19 16:47   ` Thomas Gleixner
  2021-06-20  5:52     ` [External] " 何鑫
  2021-06-20  5:40   ` 何鑫
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2021-06-19 16:47 UTC (permalink / raw)
  To: Stephen Boyd, Xin He, keescook; +Cc: linux-kernel

On Fri, Jun 18 2021 at 22:03, Stephen Boyd wrote:
> Quoting Xin He (2021-06-17 00:10:27)
>> All other functions are defined for when CONFIG_DEBUG_OBJECTS
>> is not set.
>>
>> Signed-off-by: Xin He <hexin.op@bytedance.com>
>> ---
>>  include/linux/debugobjects.h | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
>> index 8d2dde23e9fb..af0d73d8d29b 100644
>> --- a/include/linux/debugobjects.h
>> +++ b/include/linux/debugobjects.h
>> @@ -99,6 +99,9 @@ static inline void
>>  debug_object_free      (void *addr, const struct debug_obj_descr *descr) { }
>>  static inline void
>>  debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) { }
>> +static inline void
>> +debug_object_active_state(void *addr, const struct debug_obj_descr *descr,
>> +                         unsigned int expect, unsigned int next) { }
>
> I suppose it's a landmine that may go off at some point, but this isn't
> fixing anything that's broken at the moment, correct?

The two users (RCU/i915) have it guarded with RCU/I915 specific config
options which depend on CONFIG_DEBUG_OBJECTS.

I have no problem with the patch per se, but it want's a proper use case.

Thanks,

        tglx




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

* Re: [External] Re: [PATCH] debugobjects: add missing empty function debug_object_active_state()
  2021-06-19  5:03 ` Stephen Boyd
  2021-06-19 16:47   ` Thomas Gleixner
@ 2021-06-20  5:40   ` 何鑫
  1 sibling, 0 replies; 6+ messages in thread
From: 何鑫 @ 2021-06-20  5:40 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Kees Cook, tglx, linux-kernel

Stephen Boyd <swboyd@chromium.org> 于2021年6月19日周六 下午1:03写道:
>
> Quoting Xin He (2021-06-17 00:10:27)
> > All other functions are defined for when CONFIG_DEBUG_OBJECTS
> > is not set.
> >
> > Signed-off-by: Xin He <hexin.op@bytedance.com>
> > ---
> >  include/linux/debugobjects.h | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
> > index 8d2dde23e9fb..af0d73d8d29b 100644
> > --- a/include/linux/debugobjects.h
> > +++ b/include/linux/debugobjects.h
> > @@ -99,6 +99,9 @@ static inline void
> >  debug_object_free      (void *addr, const struct debug_obj_descr *descr) { }
> >  static inline void
> >  debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) { }
> > +static inline void
> > +debug_object_active_state(void *addr, const struct debug_obj_descr *descr,
> > +                         unsigned int expect, unsigned int next) { }
>
> I suppose it's a landmine that may go off at some point, but this isn't
> fixing anything that's broken at the moment, correct?

Yes, you are rigth.

Thanks.

>
> >
> >  static inline void debug_objects_early_init(void) { }
> >  static inline void debug_objects_mem_init(void) { }

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

* Re: [External] Re: [PATCH] debugobjects: add missing empty function debug_object_active_state()
  2021-06-19 16:47   ` Thomas Gleixner
@ 2021-06-20  5:52     ` 何鑫
  2021-06-20 11:09       ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: 何鑫 @ 2021-06-20  5:52 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Stephen Boyd, Kees Cook, linux-kernel

Thomas Gleixner <tglx@linutronix.de> 于2021年6月20日周日 上午12:47写道:
>
> On Fri, Jun 18 2021 at 22:03, Stephen Boyd wrote:
> > Quoting Xin He (2021-06-17 00:10:27)
> >> All other functions are defined for when CONFIG_DEBUG_OBJECTS
> >> is not set.
> >>
> >> Signed-off-by: Xin He <hexin.op@bytedance.com>
> >> ---
> >>  include/linux/debugobjects.h | 3 +++
> >>  1 file changed, 3 insertions(+)
> >>
> >> diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
> >> index 8d2dde23e9fb..af0d73d8d29b 100644
> >> --- a/include/linux/debugobjects.h
> >> +++ b/include/linux/debugobjects.h
> >> @@ -99,6 +99,9 @@ static inline void
> >>  debug_object_free      (void *addr, const struct debug_obj_descr *descr) { }
> >>  static inline void
> >>  debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) { }
> >> +static inline void
> >> +debug_object_active_state(void *addr, const struct debug_obj_descr *descr,
> >> +                         unsigned int expect, unsigned int next) { }
> >
> > I suppose it's a landmine that may go off at some point, but this isn't
> > fixing anything that's broken at the moment, correct?
>
> The two users (RCU/i915) have it guarded with RCU/I915 specific config
> options which depend on CONFIG_DEBUG_OBJECTS.
>
> I have no problem with the patch per se, but it want's a proper use case.
>
> Thanks,
>
>         tglx
>
>
>

Yes, config options ensure that there will be no problems. But when
CONFIG_DEBUG_OBJECTS is not set, we should provide all empty
functions that may be used.

Thanks.

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

* Re: [External] Re: [PATCH] debugobjects: add missing empty function debug_object_active_state()
  2021-06-20  5:52     ` [External] " 何鑫
@ 2021-06-20 11:09       ` Thomas Gleixner
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2021-06-20 11:09 UTC (permalink / raw)
  To: 何鑫; +Cc: Stephen Boyd, Kees Cook, linux-kernel

On Sun, Jun 20 2021 at 13:52, 何鑫 wrote:
> Thomas Gleixner <tglx@linutronix.de> 于2021年6月20日周日 上午12:47写道:
>>
>> I have no problem with the patch per se, but it want's a proper use case.
>
> Yes, config options ensure that there will be no problems. But when
> CONFIG_DEBUG_OBJECTS is not set, we should provide all empty
> functions that may be used.

What for? Just that we have them w/o users? If someone needs it w/o
guards then we still can add it.

What's the actual problem you are trying to solve?

Thanks,

        tglx

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

end of thread, other threads:[~2021-06-20 11:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  7:10 [PATCH] debugobjects: add missing empty function debug_object_active_state() Xin He
2021-06-19  5:03 ` Stephen Boyd
2021-06-19 16:47   ` Thomas Gleixner
2021-06-20  5:52     ` [External] " 何鑫
2021-06-20 11:09       ` Thomas Gleixner
2021-06-20  5:40   ` 何鑫

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.