* [PATCH v2] checkpatch: Mark kunmap() and kunmap_atomic() deprecated
@ 2022-12-29 22:17 Ira Weiny
2022-12-30 0:12 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Ira Weiny @ 2022-12-29 22:17 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches
Cc: linux-kernel, Fabio M. De Francesco, Ira Weiny
It was suggested by Fabio that kunmap() be marked deprecated in
checkpatch.[1] This did not seem necessary until an invalid conversion
of kmap_local_page() appeared in mainline.[2][3] The introduction of
this bug would have been flagged with kunmap() being marked deprecated.
Add kunmap() and kunmap_atomic() to checkpatch to help prevent further
confusion.
[1] https://lore.kernel.org/all/1884934.6tgchFWduM@suse/
[2] d406d26745ab ("cifs: skip alloc when request has no pages")
[3] https://lore.kernel.org/r/20221229-cifs-kmap-v1-1-c70d0e9a53eb@intel.com
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Suggested-by: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
Changes in v2:
- Add LKML and send directly to Andy and Joe (I'm still learning b4 send...)
- Link to v1: https://lore.kernel.org/r/20221229-kmap-checkpatch-v1-1-6b86bcf5080a@intel.com
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 78cc595b98ce..a6d6d7e1d0cf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -823,7 +823,9 @@ our %deprecated_apis = (
"get_state_synchronize_sched" => "get_state_synchronize_rcu",
"cond_synchronize_sched" => "cond_synchronize_rcu",
"kmap" => "kmap_local_page",
+ "kunmap" => "kunmap_local",
"kmap_atomic" => "kmap_local_page",
+ "kunmap_atomic" => "kunmap_local",
);
#Create a search pattern for all these strings to speed up a loop below
---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20221229-kmap-checkpatch-763cc2ace8e5
Best regards,
--
Ira Weiny <ira.weiny@intel.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] checkpatch: Mark kunmap() and kunmap_atomic() deprecated
2022-12-29 22:17 [PATCH v2] checkpatch: Mark kunmap() and kunmap_atomic() deprecated Ira Weiny
@ 2022-12-30 0:12 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2022-12-30 0:12 UTC (permalink / raw)
To: Ira Weiny, Andy Whitcroft, Andrew Morton
Cc: linux-kernel, Fabio M. De Francesco
On Thu, 2022-12-29 at 14:17 -0800, Ira Weiny wrote:
> It was suggested by Fabio that kunmap() be marked deprecated in
> checkpatch.[1] This did not seem necessary until an invalid conversion
> of kmap_local_page() appeared in mainline.[2][3] The introduction of
> this bug would have been flagged with kunmap() being marked deprecated.
>
> Add kunmap() and kunmap_atomic() to checkpatch to help prevent further
> confusion.
Acked-by: Joe Perches <joe@perches.com>
>
> [1] https://lore.kernel.org/all/1884934.6tgchFWduM@suse/
> [2] d406d26745ab ("cifs: skip alloc when request has no pages")
> [3] https://lore.kernel.org/r/20221229-cifs-kmap-v1-1-c70d0e9a53eb@intel.com
>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: Joe Perches <joe@perches.com>
> Suggested-by: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
> Changes in v2:
> - Add LKML and send directly to Andy and Joe (I'm still learning b4 send...)
> - Link to v1: https://lore.kernel.org/r/20221229-kmap-checkpatch-v1-1-6b86bcf5080a@intel.com
> ---
> scripts/checkpatch.pl | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 78cc595b98ce..a6d6d7e1d0cf 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -823,7 +823,9 @@ our %deprecated_apis = (
> "get_state_synchronize_sched" => "get_state_synchronize_rcu",
> "cond_synchronize_sched" => "cond_synchronize_rcu",
> "kmap" => "kmap_local_page",
> + "kunmap" => "kunmap_local",
> "kmap_atomic" => "kmap_local_page",
> + "kunmap_atomic" => "kunmap_local",
> );
>
> #Create a search pattern for all these strings to speed up a loop below
>
> ---
> base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
> change-id: 20221229-kmap-checkpatch-763cc2ace8e5
>
> Best regards,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-30 0:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-29 22:17 [PATCH v2] checkpatch: Mark kunmap() and kunmap_atomic() deprecated Ira Weiny
2022-12-30 0:12 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox