Skip to contentSkip to conversation

mtd: mtd-abi: Don't use C++ comments

PATCH In review Nathan Chancellor 3 participants 5 messages Jun 20, 2019 – Jun 21, 2019 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: mtd-abi: Don't use C++ comments

When compiled standalone after commit b91976b7c0e3 ("kbuild:
compile-test UAPI headers to ensure they are self-contained"), a warning about the C++ comments appears:

In file included from usr/include/mtd/mtd-user.hdrtest.c:1:
In file included from ./usr/include/mtd/mtd-user.h:25:
./usr/include/mtd/mtd-abi.h:116:28: warning: // comments are not allowed in this language [-Wcomment]

  #define MTD_NANDECC_OFF         0       // Switch off ECC (Not recommended)
                                          ^

1 warning generated.

Replace them with standard C comments so this warning no longer occurs.

---
 include/uapi/mtd/mtd-abi.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/uapi/mtd/mtd-abi.h +5 -5
index aff5b5e59845..3fe9237f723a 100644
@@ -113,11 +113,11 @@ struct mtd_write_req {
 #define MTD_CAP_NVRAM		(MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
 
 /* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
-#define MTD_NANDECC_OFF		0	// Switch off ECC (Not recommended)
-#define MTD_NANDECC_PLACE	1	// Use the given placement in the structure (YAFFS1 legacy mode)
-#define MTD_NANDECC_AUTOPLACE	2	// Use the default placement scheme
-#define MTD_NANDECC_PLACEONLY	3	// Use the given placement in the structure (Do not store ecc result on read)
-#define MTD_NANDECC_AUTOPL_USR 	4	// Use the given autoplacement scheme rather than using the default
+#define MTD_NANDECC_OFF		0	/* Switch off ECC (Not recommended) */
+#define MTD_NANDECC_PLACE	1	/* Use the given placement in the structure (YAFFS1 legacy mode) */
+#define MTD_NANDECC_AUTOPLACE	2	/* Use the default placement scheme */
+#define MTD_NANDECC_PLACEONLY	3	/* Use the given placement in the structure (Do not store ecc result on read) */
+#define MTD_NANDECC_AUTOPL_USR	4	/* Use the given autoplacement scheme rather than using the default */
 
 /* OTP mode selection */
 #define MTD_OTP_OFF		0
Signature · 1 line
2.22.0
#1 lore raw
Quoted 9 lines · Nathan Chancellor

When compiled standalone after commit b91976b7c0e3 ("kbuild:
compile-test UAPI headers to ensure they are self-contained"), a warning about the C++ comments appears:

In file included from usr/include/mtd/mtd-user.hdrtest.c:1:
In file included from ./usr/include/mtd/mtd-user.h:25:
./usr/include/mtd/mtd-abi.h:116:28: warning: // comments are not allowed in this language [-Wcomment]

Quoted 5 lines
  #define MTD_NANDECC_OFF         0       // Switch off ECC (Not recommended)
                                          ^

1 warning generated.

Replace them with standard C comments so this warning no longer occurs.

Should there be a fixes by tag?

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
Quoted 15 lines · Nick Desaulniers
Quoted 13 lines · Nathan Chancellor

When compiled standalone after commit b91976b7c0e3 ("kbuild:
compile-test UAPI headers to ensure they are self-contained"), a warning about the C++ comments appears:

In file included from usr/include/mtd/mtd-user.hdrtest.c:1:
In file included from ./usr/include/mtd/mtd-user.h:25:
./usr/include/mtd/mtd-abi.h:116:28: warning: // comments are not allowed in this language [-Wcomment]

  #define MTD_NANDECC_OFF         0       // Switch off ECC (Not recommended)
                                          ^

1 warning generated.

Quoted 6 lines
Quoted 1 line

Replace them with standard C comments so this warning no longer occurs.

Should there be a fixes by tag?

Signature · 2 lines
Thanks,
~Nick Desaulniers

Normally, I would have added one but this issue has been present since the beginning of git history. According to Thomas Gleixner's pre-git history tree, it would be:

Fixes 7df80b4c8964 ("MTD core include and device code cleanup")

but since that hash doesn't exist in the normal git history, I don't think it is worth adding. Of course, if the maintainers want to add it, I won't object.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git

Cheers,
NAthan

Reviewed-by
#3 lore raw
Quoted 8 lines · Nathan Chancellor
Quoted 1 line · Nick Desaulniers

Should there be a fixes by tag?

Normally, I would have added one but this issue has been present since the beginning of git history. According to Thomas Gleixner's pre-git history tree, it would be:

Quoted 7 lines
Fixes 7df80b4c8964 ("MTD core include and device code cleanup")

but since that hash doesn't exist in the normal git history, I don't think it is worth adding. Of course, if the maintainers want to add it, I won't object.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git

LOL good point; I wonder if the stable maintainers have thoughts on that or how they expect us to signal that case if we even need to do anything at all.

Either way, thanks for the patch and

Signature · 2 lines
Thanks,
~Nick Desaulniers
#4 lore raw
Quoted 16 lines · Nick Desaulniers
Quoted 14 lines · Nathan Chancellor
Quoted 1 line · Nick Desaulniers

Should there be a fixes by tag?

Normally, I would have added one but this issue has been present since the beginning of git history. According to Thomas Gleixner's pre-git history tree, it would be:

Fixes 7df80b4c8964 ("MTD core include and device code cleanup")

but since that hash doesn't exist in the normal git history, I don't think it is worth adding. Of course, if the maintainers want to add it, I won't object.

Quoted 5 lines
Quoted 1 line

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git

LOL good point; I wonder if the stable maintainers have thoughts on that or how they expect us to signal that case if we even need to do anything at all.

If you want it applied "since the beginning of time", then just do:

Cc <[email protected]> # 2.6.0+

or some such marking.

thanks,

greg k-h