[tip:WIP.sched/core 117/122] drivers/misc/eeprom/eeprom.c:99:2: note: in expansion of macro 'if'
From: kbuild test robot
Date: Thu Feb 02 2017 - 18:49:59 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.sched/core
head: a69a38e26e87ddbe993e33b55f693405cd62c76f
commit: bcdc18d4a46bc321d73fa769cfe294cf3cdae07d [117/122] sched/headers: Remove <linux/cred.h> inclusion from <linux/sched.h>
config: i386-randconfig-sb0-02030321 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
git checkout bcdc18d4a46bc321d73fa769cfe294cf3cdae07d
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from include/linux/linkage.h:4:0,
from include/linux/kernel.h:6,
from drivers/misc/eeprom/eeprom.c:19:
drivers/misc/eeprom/eeprom.c: In function 'eeprom_read':
drivers/misc/eeprom/eeprom.c:99:31: error: implicit declaration of function 'capable' [-Werror=implicit-function-declaration]
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> drivers/misc/eeprom/eeprom.c:99:2: note: in expansion of macro 'if'
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
drivers/misc/eeprom/eeprom.c:99:39: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> drivers/misc/eeprom/eeprom.c:99:2: note: in expansion of macro 'if'
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
drivers/misc/eeprom/eeprom.c:99:39: note: each undeclared identifier is reported only once for each function it appears in
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> drivers/misc/eeprom/eeprom.c:99:2: note: in expansion of macro 'if'
if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
^
cc1: some warnings being treated as errors
vim +/if +99 drivers/misc/eeprom/eeprom.c
110f42290f drivers/misc/eeprom/eeprom.c Arce, Abraham 2010-05-13 13 * This program is distributed in the hope that it will be useful,
110f42290f drivers/misc/eeprom/eeprom.c Arce, Abraham 2010-05-13 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
110f42290f drivers/misc/eeprom/eeprom.c Arce, Abraham 2010-05-13 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110f42290f drivers/misc/eeprom/eeprom.c Arce, Abraham 2010-05-13 16 * GNU General Public License for more details.
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 17 */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 18
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 @19 #include <linux/kernel.h>
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 20 #include <linux/module.h>
1698da2461 drivers/misc/eeprom/eeprom.c Himangi Saraogi 2014-08-02 21 #include <linux/device.h>
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 22 #include <linux/jiffies.h>
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 23 #include <linux/i2c.h>
5c085d369c drivers/i2c/chips/eeprom.c Ingo Molnar 2006-01-18 24 #include <linux/mutex.h>
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 25
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 26 /* Addresses to scan */
2cdddeb8d7 drivers/i2c/chips/eeprom.c Jean Delvare 2008-01-27 27 static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 28 0x55, 0x56, 0x57, I2C_CLIENT_END };
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 29
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 30
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 31 /* Size of EEPROM in bytes */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 32 #define EEPROM_SIZE 256
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 33
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 34 /* possible types of eeprom devices */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 35 enum eeprom_nature {
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 36 UNKNOWN,
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 37 VAIO,
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 38 };
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 39
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 40 /* Each client has this additional data */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 41 struct eeprom_data {
5c085d369c drivers/i2c/chips/eeprom.c Ingo Molnar 2006-01-18 42 struct mutex update_lock;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 43 u8 valid; /* bitfield, bit!=0 if slice is valid */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 44 unsigned long last_updated[8]; /* In jiffies, 8 slices */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 45 u8 data[EEPROM_SIZE]; /* Register values */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 46 enum eeprom_nature nature;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 47 };
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 48
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 49
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 50 static void eeprom_update_client(struct i2c_client *client, u8 slice)
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 51 {
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 52 struct eeprom_data *data = i2c_get_clientdata(client);
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 53 int i;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 54
5c085d369c drivers/i2c/chips/eeprom.c Ingo Molnar 2006-01-18 55 mutex_lock(&data->update_lock);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 56
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 57 if (!(data->valid & (1 << slice)) ||
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 58 time_after(jiffies, data->last_updated[slice] + 300 * HZ)) {
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 59 dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 60
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 61 if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
4b2643d7d9 drivers/i2c/chips/eeprom.c Jean Delvare 2007-07-12 62 for (i = slice << 5; i < (slice + 1) << 5; i += 32)
4b2643d7d9 drivers/i2c/chips/eeprom.c Jean Delvare 2007-07-12 63 if (i2c_smbus_read_i2c_block_data(client, i,
4b2643d7d9 drivers/i2c/chips/eeprom.c Jean Delvare 2007-07-12 64 32, data->data + i)
4b2643d7d9 drivers/i2c/chips/eeprom.c Jean Delvare 2007-07-12 65 != 32)
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 66 goto exit;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 67 } else {
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 68 for (i = slice << 5; i < (slice + 1) << 5; i += 2) {
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 69 int word = i2c_smbus_read_word_data(client, i);
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 70 if (word < 0)
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 71 goto exit;
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 72 data->data[i] = word & 0xff;
1b4dff9cd3 drivers/i2c/chips/eeprom.c Jean Delvare 2008-07-14 73 data->data[i + 1] = word >> 8;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 74 }
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 75 }
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 76 data->last_updated[slice] = jiffies;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 77 data->valid |= (1 << slice);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 78 }
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 79 exit:
5c085d369c drivers/i2c/chips/eeprom.c Ingo Molnar 2006-01-18 80 mutex_unlock(&data->update_lock);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 81 }
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 82
2c3c8bea60 drivers/misc/eeprom/eeprom.c Chris Wright 2010-05-12 83 static ssize_t eeprom_read(struct file *filp, struct kobject *kobj,
2c3c8bea60 drivers/misc/eeprom/eeprom.c Chris Wright 2010-05-12 84 struct bin_attribute *bin_attr,
91a6902958 drivers/i2c/chips/eeprom.c Zhang Rui 2007-06-09 85 char *buf, loff_t off, size_t count)
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 86 {
092462c2b5 drivers/misc/eeprom/eeprom.c Geliang Tang 2016-01-13 87 struct i2c_client *client = to_i2c_client(kobj_to_dev(kobj));
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 88 struct eeprom_data *data = i2c_get_clientdata(client);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 89 u8 slice;
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 90
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 91 /* Only refresh slices which contain requested bytes */
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 92 for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 93 eeprom_update_client(client, slice);
^1da177e4c drivers/i2c/chips/eeprom.c Linus Torvalds 2005-04-16 94
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 95 /* Hide Vaio private settings to regular users:
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 96 - BIOS passwords: bytes 0x00 to 0x0f
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 97 - UUID: bytes 0x10 to 0x1f
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 98 - Serial number: 0xc0 to 0xdf */
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 @99 if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) {
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 100 int i;
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 101
0f2cbd38aa drivers/i2c/chips/eeprom.c Jean Delvare 2007-11-15 102 for (i = 0; i < count; i++) {
:::::: The code at line 99 was first introduced by commit
:::::: 0f2cbd38aa377e30df3b7602abed69464d1970aa i2c/eeprom: Hide Sony Vaio serial numbers
:::::: TO: Jean Delvare <khali@xxxxxxxxxxxx>
:::::: CC: Jean Delvare <khali@xxxxxxxxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip