Skip to contentSkip to conversation

lib: fix incorrect kernel-doc comment syntax in file

PATCH In review Aditya Srivastava 3 participants 3 messages Mar 29, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: fix incorrect kernel-doc comment syntax in file

The opening comment mark '/**' is used for highlighting the beginning of kernel-doc comments.
There are certain files in lib and lib/zstd, which follow this syntax, but the content inside does not comply with kernel-doc.
Such lines were probably not meant for kernel-doc parsing, but are parsed due to the presence of kernel-doc like comment syntax(i.e, '/**'), which causes unexpected warnings from kernel-doc.

E.g., presence of kernel-doc like comment in lib/zstd/compress.c at header causes these warnings by kernel-doc:
"warning: cannot understand function prototype: 'const U32 g_searchStrength = 8; '"

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment format, i.e. '/*', to prevent kernel-doc from parsing it.

---
* Applies perfectly on next-20210326

 lib/win_minmax.c         | 2 +-
 lib/zstd/compress.c      | 2 +-
 lib/zstd/decompress.c    | 2 +-
 lib/zstd/error_private.h | 2 +-
 lib/zstd/mem.h           | 2 +-
 lib/zstd/zstd_common.c   | 2 +-
 lib/zstd/zstd_internal.h | 2 +-
 lib/zstd/zstd_opt.h      | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
lib/win_minmax.c +1 -1
index 6bdc1cd15f76..ec10506834b6 100644
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
-/**
+/*
  * lib/minmax.c: windowed min/max tracker
  *
  * Kathleen Nichols' algorithm for tracking the minimum (or maximum)
lib/zstd/compress.c +1 -1
index b080264ed3ad..42604785c4f2 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/decompress.c +1 -1
index 66cd487a326a..b28f10f21a6c 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/error_private.h +1 -1
index 1a60b31f706c..f7dfa4a18f27 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/mem.h +1 -1
index 93d7a2c377fe..97d92eb431a5 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_common.c +1 -1
index a282624ee155..ebf848c1f348 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_internal.h +1 -1
index dac753397f86..5f02411bded1 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_opt.h +1 -1
index 55e1b4cba808..b4a02b9f76d8 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
Signature · 6 lines
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Aditya Srivastava

The opening comment mark '/**' is used for highlighting the beginning of kernel-doc comments.
There are certain files in lib and lib/zstd, which follow this syntax, but the content inside does not comply with kernel-doc.
Such lines were probably not meant for kernel-doc parsing, but are parsed due to the presence of kernel-doc like comment syntax(i.e, '/**'), which causes unexpected warnings from kernel-doc.

E.g., presence of kernel-doc like comment in lib/zstd/compress.c at header causes these warnings by kernel-doc:
"warning: cannot understand function prototype: 'const U32 g_searchStrength = 8; '"

Quoted 6 lines

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment format, i.e. '/*', to prevent kernel-doc from parsing it.

Thanks.

Quoted 95 lines

---
* Applies perfectly on next-20210326

 lib/win_minmax.c         | 2 +-
 lib/zstd/compress.c      | 2 +-
 lib/zstd/decompress.c    | 2 +-
 lib/zstd/error_private.h | 2 +-
 lib/zstd/mem.h           | 2 +-
 lib/zstd/zstd_common.c   | 2 +-
 lib/zstd/zstd_internal.h | 2 +-
 lib/zstd/zstd_opt.h      | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
lib/win_minmax.c +1 -1
index 6bdc1cd15f76..ec10506834b6 100644
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
-/**
+/*
  * lib/minmax.c: windowed min/max tracker
  *
  * Kathleen Nichols' algorithm for tracking the minimum (or maximum)
lib/zstd/compress.c +1 -1
index b080264ed3ad..42604785c4f2 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/decompress.c +1 -1
index 66cd487a326a..b28f10f21a6c 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/error_private.h +1 -1
index 1a60b31f706c..f7dfa4a18f27 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/mem.h +1 -1
index 93d7a2c377fe..97d92eb431a5 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_common.c +1 -1
index a282624ee155..ebf848c1f348 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_internal.h +1 -1
index dac753397f86..5f02411bded1 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
lib/zstd/zstd_opt.h +1 -1
index 55e1b4cba808..b4a02b9f76d8 100644
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
  * All rights reserved.
  *
Signature · 6 lines
~Randy

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Acked-by on v1 1/1
#2 lore raw
In reply to Aditya Srivastava
Quoted 3 lines · Aditya Srivastava

Provide a simple fix by replacing such occurrences with general comment format, i.e. '/*', to prevent kernel-doc from parsing it.

I assumed these come from the original sources and were not adapted, but they aren't there, at least in the current version in GitHub.

Cheers,
Miguel
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees