linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Gireesh.Hiremath@in.bosch.com,
	linux-omap@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	bcousson@baylibre.com, tony@atomide.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, dmitry.torokhov@gmail.com,
	mkorpershoek@baylibre.com, davidgow@google.com,
	m.felsch@pengutronix.de, swboyd@chromium.org,
	fengping.yu@mediatek.com, y.oudjana@protonmail.com,
	rdunlap@infradead.org, colin.king@intel.com
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	sjoerd.simons@collabora.co.uk, VinayKumar.Shettar@in.bosch.com,
	Govindaraji.Sivanantham@in.bosch.com,
	anaclaudia.dias@de.bosch.com
Subject: Re: [PATCH v3 1/3] driver: input: matric-keypad: switch to gpiod
Date: Mon, 22 Aug 2022 10:36:46 +0300	[thread overview]
Message-ID: <202208192340.m1XMlTj5-lkp@intel.com> (raw)
In-Reply-To: <20220819065946.9572-1-Gireesh.Hiremath@in.bosch.com>

Hi,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gireesh-Hiremath-in-bosch-com/driver-input-matric-keypad-switch-to-gpiod/20220819-151155
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220819/202208192340.m1XMlTj5-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/input/keyboard/matrix_keypad.c:432 matrix_keypad_parse_dt() error: uninitialized symbol 'ret'.

Old smatch warnings:
drivers/input/keyboard/matrix_keypad.c:439 matrix_keypad_parse_dt() error: uninitialized symbol 'ret'.

vim +/ret +432 drivers/input/keyboard/matrix_keypad.c

5298cc4cc753bb Bill Pemberton   2012-11-23  380  static struct matrix_keypad_platform_data *
4a83eecff65bd3 AnilKumar Ch     2012-11-20  381  matrix_keypad_parse_dt(struct device *dev)
4a83eecff65bd3 AnilKumar Ch     2012-11-20  382  {
4a83eecff65bd3 AnilKumar Ch     2012-11-20  383  	struct matrix_keypad_platform_data *pdata;
4a83eecff65bd3 AnilKumar Ch     2012-11-20  384  	struct device_node *np = dev->of_node;
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  385  	struct gpio_desc **gpios;
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  386  	struct gpio_desc *desc;
d55bda1b3e7c5a Christian Hoff   2018-11-12  387  	int ret, i, nrow, ncol;
4a83eecff65bd3 AnilKumar Ch     2012-11-20  388  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  389  	if (!np) {
4a83eecff65bd3 AnilKumar Ch     2012-11-20  390  		dev_err(dev, "device lacks DT data\n");
4a83eecff65bd3 AnilKumar Ch     2012-11-20  391  		return ERR_PTR(-ENODEV);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  392  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  393  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  394  	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  395  	if (!pdata) {
4a83eecff65bd3 AnilKumar Ch     2012-11-20  396  		dev_err(dev, "could not allocate memory for platform data\n");
4a83eecff65bd3 AnilKumar Ch     2012-11-20  397  		return ERR_PTR(-ENOMEM);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  398  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  399  
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  400  	pdata->num_row_gpios = nrow = gpiod_count(dev, "row");
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  401  	pdata->num_col_gpios = ncol = gpiod_count(dev, "col");
e80beb27d2f81a Grant Likely     2013-02-12  402  	if (nrow <= 0 || ncol <= 0) {
4a83eecff65bd3 AnilKumar Ch     2012-11-20  403  		dev_err(dev, "number of keypad rows/columns not specified\n");
4a83eecff65bd3 AnilKumar Ch     2012-11-20  404  		return ERR_PTR(-EINVAL);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  405  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  406  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  407  	if (of_get_property(np, "linux,no-autorepeat", NULL))
4a83eecff65bd3 AnilKumar Ch     2012-11-20  408  		pdata->no_autorepeat = true;
aeda5003d0b987 Dmitry Torokhov  2015-07-16  409  
aeda5003d0b987 Dmitry Torokhov  2015-07-16  410  	pdata->wakeup = of_property_read_bool(np, "wakeup-source") ||
aeda5003d0b987 Dmitry Torokhov  2015-07-16  411  			of_property_read_bool(np, "linux,wakeup"); /* legacy */
aeda5003d0b987 Dmitry Torokhov  2015-07-16  412  
aa0e26bb786b00 David Rivshin    2017-03-29  413  	pdata->drive_inactive_cols =
aa0e26bb786b00 David Rivshin    2017-03-29  414  		of_property_read_bool(np, "drive-inactive-cols");
aa0e26bb786b00 David Rivshin    2017-03-29  415  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  416  	of_property_read_u32(np, "debounce-delay-ms", &pdata->debounce_ms);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  417  	of_property_read_u32(np, "col-scan-delay-us",
4a83eecff65bd3 AnilKumar Ch     2012-11-20  418  						&pdata->col_scan_delay_us);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  419  
a86854d0c599b3 Kees Cook        2018-06-12  420  	gpios = devm_kcalloc(dev,
a86854d0c599b3 Kees Cook        2018-06-12  421  			     pdata->num_row_gpios + pdata->num_col_gpios,
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  422  			     sizeof(*gpios),
4a83eecff65bd3 AnilKumar Ch     2012-11-20  423  			     GFP_KERNEL);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  424  	if (!gpios) {
4a83eecff65bd3 AnilKumar Ch     2012-11-20  425  		dev_err(dev, "could not allocate memory for gpios\n");
4a83eecff65bd3 AnilKumar Ch     2012-11-20  426  		return ERR_PTR(-ENOMEM);
4a83eecff65bd3 AnilKumar Ch     2012-11-20  427  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  428  
d55bda1b3e7c5a Christian Hoff   2018-11-12  429  	for (i = 0; i < nrow; i++) {
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  430  		desc = devm_gpiod_get_index(dev, "row", i, GPIOD_IN);
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  431  		if (IS_ERR(desc))
d55bda1b3e7c5a Christian Hoff   2018-11-12 @432  			return ERR_PTR(ret);

s/ret/desc/

90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  433  		gpios[i] = desc;
d55bda1b3e7c5a Christian Hoff   2018-11-12  434  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  435  
d55bda1b3e7c5a Christian Hoff   2018-11-12  436  	for (i = 0; i < ncol; i++) {
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  437  		desc = devm_gpiod_get_index(dev, "col", i, GPIOD_IN);
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  438  		if (IS_ERR(desc))
d55bda1b3e7c5a Christian Hoff   2018-11-12  439  			return ERR_PTR(ret);
90bb4ee8dc3c27 Gireesh Hiremath 2022-08-19  440  		gpios[nrow + i] = desc;
d55bda1b3e7c5a Christian Hoff   2018-11-12  441  	}
4a83eecff65bd3 AnilKumar Ch     2012-11-20  442  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  443  	pdata->row_gpios = gpios;
4a83eecff65bd3 AnilKumar Ch     2012-11-20  444  	pdata->col_gpios = &gpios[pdata->num_row_gpios];
4a83eecff65bd3 AnilKumar Ch     2012-11-20  445  
4a83eecff65bd3 AnilKumar Ch     2012-11-20  446  	return pdata;
4a83eecff65bd3 AnilKumar Ch     2012-11-20  447  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


      parent reply	other threads:[~2022-08-22  7:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  6:59 [PATCH v3 1/3] driver: input: matric-keypad: switch to gpiod Gireesh.Hiremath
2022-08-19  6:59 ` [PATCH v3 2/3] driver: input: matric-keypad: add reduced matrix support Gireesh.Hiremath
2022-08-19 10:35   ` kernel test robot
2022-08-19 11:45   ` kernel test robot
2022-08-19 12:10   ` Krzysztof Kozlowski
2022-08-22  7:40   ` Dan Carpenter
2022-08-19  6:59 ` [PATCH v3 3/3] dt-bindings: input: gpio-matrix-keypad: add reduced matrix keypad bindings definition Gireesh.Hiremath
2022-08-22 18:22   ` Rob Herring
2022-08-19 12:08 ` [PATCH v3 1/3] driver: input: matric-keypad: switch to gpiod Krzysztof Kozlowski
2022-08-19 13:12 ` Marco Felsch
2022-08-20  0:59   ` Dmitry Torokhov
2022-08-20 19:36     ` Marco Felsch
2022-08-21  5:00       ` Dmitry Torokhov
2022-08-22  7:36 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208192340.m1XMlTj5-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=Gireesh.Hiremath@in.bosch.com \
    --cc=Govindaraji.Sivanantham@in.bosch.com \
    --cc=VinayKumar.Shettar@in.bosch.com \
    --cc=anaclaudia.dias@de.bosch.com \
    --cc=bcousson@baylibre.com \
    --cc=colin.king@intel.com \
    --cc=davidgow@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fengping.yu@mediatek.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=m.felsch@pengutronix.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=swboyd@chromium.org \
    --cc=tony@atomide.com \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).