From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Amy Parker <apark0006@student.cerritos.edu>,
pavel@ucw.cz
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Amy Parker <apark0006@student.cerritos.edu>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] swap led_brightness from enum to typedef
Date: Mon, 19 Jul 2021 11:05:38 +0300 [thread overview]
Message-ID: <202107161044.asWDkkC7-lkp@intel.com> (raw)
In-Reply-To: <9b5902665dcc4c0fca7546987303e348d8657f59.1626383424.git.apark0006@student.cerritos.edu>
Hi Amy,
url: https://github.com/0day-ci/linux/commits/Amy-Parker/leds-change-led_brightness-definition-from-enum-to-typedef/20210716-052140
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd9c7df94c1b23feacd54112f33ad95d93f64533
config: i386-randconfig-m021-20210715 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/hid/hid-corsair.c:157 k90_backlight_get() warn: signedness bug returning '(-12)'
vim +157 drivers/hid/hid-corsair.c
b14a971f104520 Amy Parker 2021-07-15 145 static led_brightness k90_backlight_get(struct led_classdev *led_cdev)
^^^^^^^^^^^^^^
Just declare this as int instead of typedef.
6f78193ee9ea55 Clément Vuchener 2015-09-30 146 {
6f78193ee9ea55 Clément Vuchener 2015-09-30 147 int ret;
6f78193ee9ea55 Clément Vuchener 2015-09-30 148 struct k90_led *led = container_of(led_cdev, struct k90_led, cdev);
6f78193ee9ea55 Clément Vuchener 2015-09-30 149 struct device *dev = led->cdev.dev->parent;
6f78193ee9ea55 Clément Vuchener 2015-09-30 150 struct usb_interface *usbif = to_usb_interface(dev->parent);
6f78193ee9ea55 Clément Vuchener 2015-09-30 151 struct usb_device *usbdev = interface_to_usbdev(usbif);
6f78193ee9ea55 Clément Vuchener 2015-09-30 152 int brightness;
6d104af38b570d Johan Hovold 2017-01-12 153 char *data;
6d104af38b570d Johan Hovold 2017-01-12 154
6d104af38b570d Johan Hovold 2017-01-12 155 data = kmalloc(8, GFP_KERNEL);
6d104af38b570d Johan Hovold 2017-01-12 156 if (!data)
6d104af38b570d Johan Hovold 2017-01-12 @157 return -ENOMEM;
Negative error codes
6f78193ee9ea55 Clément Vuchener 2015-09-30 158
6f78193ee9ea55 Clément Vuchener 2015-09-30 159 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
6f78193ee9ea55 Clément Vuchener 2015-09-30 160 K90_REQUEST_STATUS,
6f78193ee9ea55 Clément Vuchener 2015-09-30 161 USB_DIR_IN | USB_TYPE_VENDOR |
6f78193ee9ea55 Clément Vuchener 2015-09-30 162 USB_RECIP_DEVICE, 0, 0, data, 8,
6f78193ee9ea55 Clément Vuchener 2015-09-30 163 USB_CTRL_SET_TIMEOUT);
7a546af50eb78a Johan Hovold 2017-01-12 164 if (ret < 5) {
6f78193ee9ea55 Clément Vuchener 2015-09-30 165 dev_warn(dev, "Failed to get K90 initial state (error %d).\n",
6f78193ee9ea55 Clément Vuchener 2015-09-30 166 ret);
6d104af38b570d Johan Hovold 2017-01-12 167 ret = -EIO;
6d104af38b570d Johan Hovold 2017-01-12 168 goto out;
6f78193ee9ea55 Clément Vuchener 2015-09-30 169 }
6f78193ee9ea55 Clément Vuchener 2015-09-30 170 brightness = data[4];
6f78193ee9ea55 Clément Vuchener 2015-09-30 171 if (brightness < 0 || brightness > 3) {
6f78193ee9ea55 Clément Vuchener 2015-09-30 172 dev_warn(dev,
6f78193ee9ea55 Clément Vuchener 2015-09-30 173 "Read invalid backlight brightness: %02hhx.\n",
6f78193ee9ea55 Clément Vuchener 2015-09-30 174 data[4]);
6d104af38b570d Johan Hovold 2017-01-12 175 ret = -EIO;
6d104af38b570d Johan Hovold 2017-01-12 176 goto out;
6f78193ee9ea55 Clément Vuchener 2015-09-30 177 }
6d104af38b570d Johan Hovold 2017-01-12 178 ret = brightness;
6d104af38b570d Johan Hovold 2017-01-12 179 out:
6d104af38b570d Johan Hovold 2017-01-12 180 kfree(data);
6d104af38b570d Johan Hovold 2017-01-12 181
6d104af38b570d Johan Hovold 2017-01-12 182 return ret;
6f78193ee9ea55 Clément Vuchener 2015-09-30 183 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2021-07-19 8:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-15 21:18 [PATCH 0/2] leds: change led_brightness definition from enum to typedef Amy Parker
2021-07-15 21:18 ` [PATCH 1/2] swap led_brightness " Amy Parker
2021-07-16 0:41 ` kernel test robot
2021-07-16 2:14 ` kernel test robot
2021-07-16 3:11 ` Amy Parker
2021-07-16 21:07 ` Amy Parker
2021-07-16 21:43 ` Randy Dunlap
2021-07-19 12:05 ` Pavel Machek
2021-07-19 7:16 ` Geert Uytterhoeven
2021-07-19 8:40 ` Geert Uytterhoeven
2021-08-03 21:38 ` Pavel Machek
2021-07-19 8:05 ` Dan Carpenter [this message]
2021-07-19 8:21 ` Dan Carpenter
2021-07-19 12:08 ` Pavel Machek
2021-07-15 21:18 ` [PATCH 2/2] drivers/leds/TODO: update TODO to reflect changes Amy Parker
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=202107161044.asWDkkC7-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=apark0006@student.cerritos.edu \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lkp@intel.com \
--cc=pavel@ucw.cz \
/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).