Skip to contentSkip to conversation

CHECKPATCH: strange warning on alignment modifier

DISCUSSION Igor Stoppa 2 participants 2 messages Oct 8, 2018 – Oct 9, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

I have the following fragment of code:

+struct my_struct {
+ atomic_long_t l __aligned(sizeof(atomic_long_t));
+} __aligned(sizeof(atomic_long_t));

triggering this warning, when fed to checkpatch.pl:

WARNING: function definition argument 'atomic_long_t' should also have an identifier name #19: FILE: path/to/file.h
+ atomic_long_t l __aligned(sizeof(atomic_long_t));

gcc [(Ubuntu 7.3.0-16ubuntu3) 7.3.0] seems to be happy about it

I am using the HEAD from mainline.

My intent is to specify the alignment of both the field and the structure (yes, probably redundant in this single-field case).

If I am doing something wrong, I can't figure out what it is, but I don't understand why the WARNING is mentioning a function definition.

--
igor

#1 lore raw
Quoted 19 lines · Igor Stoppa

Hi,

I have the following fragment of code:

(quoted diff) +3 -0
+struct my_struct {
+       atomic_long_t l __aligned(sizeof(atomic_long_t));
+} __aligned(sizeof(atomic_long_t));

triggering this warning, when fed to checkpatch.pl:

WARNING: function definition argument 'atomic_long_t' should also have an identifier name
#19: FILE: path/to/file.h

(quoted diff) +1 -0
+	atomic_long_t l __aligned(sizeof(atomic_long_t));

gcc [(Ubuntu 7.3.0-16ubuntu3) 7.3.0] seems to be happy about it

Quoted 7 lines

I am using the HEAD from mainline.

My intent is to specify the alignment of both the field and the structure (yes, probably redundant in this single-field case).

If I am doing something wrong, I can't figure out what it is, but I don't understand why the WARNING is mentioning a function definition.

It's a defect in checkpatch.
For now, just ignore the message.
I will work on it later.