* [PATCH] thermal: intel: hfi: remove null check after call container_of()
@ 2022-05-17 1:31 Haowen Bai
2022-05-18 18:54 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-05-17 1:31 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
Cc: Haowen Bai, linux-pm, linux-kernel
container_of() will never return NULL, so remove useless code.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
drivers/thermal/intel/intel_hfi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c
index 730fd121df6e..a0640f762dc5 100644
--- a/drivers/thermal/intel/intel_hfi.c
+++ b/drivers/thermal/intel/intel_hfi.c
@@ -243,8 +243,6 @@ static void hfi_update_work_fn(struct work_struct *work)
hfi_instance = container_of(to_delayed_work(work), struct hfi_instance,
update_work);
- if (!hfi_instance)
- return;
update_capabilities(hfi_instance);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: intel: hfi: remove null check after call container_of()
2022-05-17 1:31 [PATCH] thermal: intel: hfi: remove null check after call container_of() Haowen Bai
@ 2022-05-18 18:54 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-05-18 18:54 UTC (permalink / raw)
To: Haowen Bai
Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
Linux PM, Linux Kernel Mailing List
On Tue, May 17, 2022 at 3:31 AM Haowen Bai <baihaowen@meizu.com> wrote:
>
> container_of() will never return NULL, so remove useless code.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> drivers/thermal/intel/intel_hfi.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c
> index 730fd121df6e..a0640f762dc5 100644
> --- a/drivers/thermal/intel/intel_hfi.c
> +++ b/drivers/thermal/intel/intel_hfi.c
> @@ -243,8 +243,6 @@ static void hfi_update_work_fn(struct work_struct *work)
>
> hfi_instance = container_of(to_delayed_work(work), struct hfi_instance,
> update_work);
> - if (!hfi_instance)
> - return;
>
> update_capabilities(hfi_instance);
> }
> --
Applied with adjusted subject as 5.19 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-18 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 1:31 [PATCH] thermal: intel: hfi: remove null check after call container_of() Haowen Bai
2022-05-18 18:54 ` Rafael J. Wysocki
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).