lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201803010804.5uRg5E6b%fengguang.wu@intel.com>
Date:   Thu, 1 Mar 2018 09:02:32 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Enric Balletbo i Serra <enric.balletbo@...labora.com>
Cc:     kbuild-all@...org, Lee Jones <lee.jones@...aro.org>,
        Benson Leung <bleung@...omium.org>,
        linux-kernel@...r.kernel.org, kernel@...labora.com,
        groeck@...omium.org, gwendal@...omium.org,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Shawn Nematbakhsh <shawnn@...omium.org>
Subject: Re: [PATCH v2 5/6] platform/chrome: cros_ec_debugfs: Add PD port
 info to debugfs

Hi Shawn,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.16-rc3 next-20180228]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Enric-Balletbo-i-Serra/platform-chrome-cros_ec_sysfs-Modify-error-handling/20180223-053556
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: x86_64-randconfig-s2-03010719 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/platform/chrome/cros_ec_debugfs.c: In function 'cros_ec_pdinfo_read':
>> drivers/platform/chrome/cros_ec_debugfs.c:219:16: error: 'EC_USB_PD_MAX_PORTS' undeclared (first use in this function)
     char read_buf[EC_USB_PD_MAX_PORTS * 40], *p = read_buf;
                   ^~~~~~~~~~~~~~~~~~~
   drivers/platform/chrome/cros_ec_debugfs.c:219:16: note: each undeclared identifier is reported only once for each function it appears in
   drivers/platform/chrome/cros_ec_debugfs.c:219:7: warning: unused variable 'read_buf' [-Wunused-variable]
     char read_buf[EC_USB_PD_MAX_PORTS * 40], *p = read_buf;
          ^~~~~~~~
   drivers/platform/chrome/cros_ec_debugfs.c:264:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +/EC_USB_PD_MAX_PORTS +219 drivers/platform/chrome/cros_ec_debugfs.c

   213	
   214	static ssize_t cros_ec_pdinfo_read(struct file *file,
   215					   char __user *user_buf,
   216					   size_t count,
   217					   loff_t *ppos)
   218	{
 > 219		char read_buf[EC_USB_PD_MAX_PORTS * 40], *p = read_buf;
   220		struct cros_ec_debugfs *debug_info = file->private_data;
   221		struct cros_ec_device *ec_dev = debug_info->ec->ec_dev;
   222		struct {
   223			struct cros_ec_command msg;
   224			union {
   225				struct ec_response_usb_pd_control_v1 resp;
   226				struct ec_params_usb_pd_control params;
   227			};
   228		} __packed ec_buf;
   229		struct cros_ec_command *msg;
   230		struct ec_response_usb_pd_control_v1 *resp;
   231		struct ec_params_usb_pd_control *params;
   232		int i;
   233	
   234		msg = &ec_buf.msg;
   235		params = (struct ec_params_usb_pd_control *)msg->data;
   236		resp = (struct ec_response_usb_pd_control_v1 *)msg->data;
   237	
   238		msg->command = EC_CMD_USB_PD_CONTROL;
   239		msg->version = 1;
   240		msg->insize = sizeof(*resp);
   241		msg->outsize = sizeof(*params);
   242	
   243		/*
   244		 * Read status from all PD ports until failure, typically caused
   245		 * by attempting to read status on a port that doesn't exist.
   246		 */
   247		for (i = 0; i < EC_USB_PD_MAX_PORTS; ++i) {
   248			params->port = i;
   249			params->role = 0;
   250			params->mux = 0;
   251			params->swap = 0;
   252	
   253			if (cros_ec_cmd_xfer_status(ec_dev, msg) < 0)
   254				break;
   255	
   256			p += scnprintf(p, sizeof(read_buf) + read_buf - p,
   257				       "p%d: %s en:%.2x role:%.2x pol:%.2x\n", i,
   258				       resp->state, resp->enabled, resp->role,
   259				       resp->polarity);
   260		}
   261	
   262		return simple_read_from_buffer(user_buf, count, ppos,
   263					       read_buf, p - read_buf);
   264	}
   265	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (29320 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ