All of lore.kernel.org
 help / color / mirror / Atom feed
* CHECKPATCH: strange warning on alignment modifier
@ 2018-10-08  7:56 Igor Stoppa
  2018-10-09  2:07 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Stoppa @ 2018-10-08  7:56 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: CHECKPATCH: strange warning on alignment modifier
  2018-10-08  7:56 CHECKPATCH: strange warning on alignment modifier Igor Stoppa
@ 2018-10-09  2:07 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2018-10-09  2:07 UTC (permalink / raw)
  To: Igor Stoppa, Andy Whitcroft; +Cc: Linux Kernel Mailing List

On Mon, 2018-10-08 at 10:56 +0300, Igor Stoppa wrote:
> 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.

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-09  2:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08  7:56 CHECKPATCH: strange warning on alignment modifier Igor Stoppa
2018-10-09  2:07 ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.