All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Resolving "false positive" error message from checkpatch.pl
@ 2017-02-03 10:11 Slawomir Stepien
  2017-02-03 10:27 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Slawomir Stepien @ 2017-02-03 10:11 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-iio, gregkh, devel

Hi all

There is a "false positive" error reported by checkpatch.pl:

ERROR: Use 4 digit octal (0777) not decimal permissions
#272: FILE: drivers/staging/iio/meter/ade7759.c:272:
+static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+		ade7759_read_8bit,
+		ade7759_write_8bit,
+		ADE7759_CH1OS);

ERROR: Use 4 digit octal (0777) not decimal permissions
#276: FILE: drivers/staging/iio/meter/ade7759.c:276:
+static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+		ade7759_read_8bit,
+		ade7759_write_8bit,
+		ADE7759_CH2OS);

The same for the file drivers/staging/iio/meter/ade7753.c.

We can see that this macro is matched by the pattern "IIO_DEV_ATTR_[A-Z_]+" from
@mode_permission_funcs in checkpatch.pl.

My question is: how this should be fixed?

>From what I can say, it's a false positive so the correct way to fix it is to
change the matching pattern: "IIO_DEV_ATTR_(?!CH_OFF)[A-Z_]+".

Or maybe the fix should be done in iio code - argument position inside this
macro?

-- 
Slawomir Stepien

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

end of thread, other threads:[~2017-02-03 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03 10:11 [RFC] Resolving "false positive" error message from checkpatch.pl Slawomir Stepien
2017-02-03 10:27 ` Greg KH
2017-02-03 12:10   ` Slawomir Stepien
2017-02-03 12:32     ` Greg KH
2017-02-03 12:39     ` Joe Perches
2017-02-03 13:04       ` Slawomir Stepien

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.