Re: [PATCH] platform/x86: dell-privacy: Add support for new privacy driver

From: kernel test robot
Date: Tue Nov 03 2020 - 11:22:47 EST


Hi Perry,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.10-rc2]
[cannot apply to next-20201103]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Perry-Yuan/platform-x86-dell-privacy-Add-support-for-new-privacy-driver/20201103-205721
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b7cbaf59f62f8ab8f157698f9e31642bff525bd0
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/cee9f60d7ca58d8f0c6b113c5f7af2dec7e2e27d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Perry-Yuan/platform-x86-dell-privacy-Add-support-for-new-privacy-driver/20201103-205721
git checkout cee9f60d7ca58d8f0c6b113c5f7af2dec7e2e27d
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/platform/x86/dell-laptop.c: In function 'dell_init':
>> drivers/platform/x86/dell-laptop.c:2212:46: warning: comparison of constant '-19' with boolean expression is always false [-Wbool-compare]
2212 | privacy_valid = dell_privacy_valid() == -ENODEV;
| ^~
drivers/platform/x86/dell-laptop.c: In function 'dell_exit':
drivers/platform/x86/dell-laptop.c:2289:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
2289 | if (!privacy_valid)
| ^~
drivers/platform/x86/dell-laptop.c:2291:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
2291 | dell_cleanup_rfkill();
| ^~~~~~~~~~~~~~~~~~~
--
drivers/platform/x86/dell-privacy-wmi.c: In function 'init_dell_privacy':
drivers/platform/x86/dell-privacy-wmi.c:225:9: warning: unused variable 'ret' [-Wunused-variable]
225 | int ret, wmi, acpi;
| ^~~
drivers/platform/x86/dell-privacy-wmi.c: At top level:
>> drivers/platform/x86/dell-privacy-wmi.c:242:6: warning: no previous prototype for 'exit_dell_privacy_wmi' [-Wmissing-prototypes]
242 | void exit_dell_privacy_wmi(void)
| ^~~~~~~~~~~~~~~~~~~~~

vim +2212 drivers/platform/x86/dell-laptop.c

2165
2166 static int __init dell_init(void)
2167 {
2168 struct calling_interface_token *token;
2169 int max_intensity = 0;
2170 int ret;
2171
2172 if (!dmi_check_system(dell_device_table))
2173 return -ENODEV;
2174
2175 quirks = NULL;
2176 /* find if this machine support other functions */
2177 dmi_check_system(dell_quirks);
2178
2179 ret = platform_driver_register(&platform_driver);
2180 if (ret)
2181 goto fail_platform_driver;
2182 platform_device = platform_device_alloc("dell-laptop", -1);
2183 if (!platform_device) {
2184 ret = -ENOMEM;
2185 goto fail_platform_device1;
2186 }
2187 ret = platform_device_add(platform_device);
2188 if (ret)
2189 goto fail_platform_device2;
2190
2191 ret = dell_setup_rfkill();
2192
2193 if (ret) {
2194 pr_warn("Unable to setup rfkill\n");
2195 goto fail_rfkill;
2196 }
2197
2198 if (quirks && quirks->touchpad_led)
2199 touchpad_led_init(&platform_device->dev);
2200
2201 kbd_led_init(&platform_device->dev);
2202
2203 dell_laptop_dir = debugfs_create_dir("dell_laptop", NULL);
2204 debugfs_create_file("rfkill", 0444, dell_laptop_dir, NULL,
2205 &dell_debugfs_fops);
2206
2207 dell_laptop_register_notifier(&dell_laptop_notifier);
2208
2209 if (dell_smbios_find_token(GLOBAL_MIC_MUTE_DISABLE) &&
2210 dell_smbios_find_token(GLOBAL_MIC_MUTE_ENABLE)) {
2211 #if IS_ENABLED(CONFIG_DELL_PRIVACY)
> 2212 privacy_valid = dell_privacy_valid() == -ENODEV;
2213 #endif
2214 if (!privacy_valid) {
2215 micmute_led_cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
2216 ret = led_classdev_register(&platform_device->dev, &micmute_led_cdev);
2217 if (ret < 0)
2218 goto fail_led;
2219 }
2220 }
2221
2222 if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
2223 return 0;
2224
2225 token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
2226 if (token) {
2227 struct calling_interface_buffer buffer;
2228
2229 dell_fill_request(&buffer, token->location, 0, 0, 0);
2230 ret = dell_send_request(&buffer,
2231 CLASS_TOKEN_READ, SELECT_TOKEN_AC);
2232 if (ret == 0)
2233 max_intensity = buffer.output[3];
2234 }
2235
2236 if (max_intensity) {
2237 struct backlight_properties props;
2238 memset(&props, 0, sizeof(struct backlight_properties));
2239 props.type = BACKLIGHT_PLATFORM;
2240 props.max_brightness = max_intensity;
2241 dell_backlight_device = backlight_device_register("dell_backlight",
2242 &platform_device->dev,
2243 NULL,
2244 &dell_ops,
2245 &props);
2246
2247 if (IS_ERR(dell_backlight_device)) {
2248 ret = PTR_ERR(dell_backlight_device);
2249 dell_backlight_device = NULL;
2250 goto fail_backlight;
2251 }
2252
2253 dell_backlight_device->props.brightness =
2254 dell_get_intensity(dell_backlight_device);
2255 if (dell_backlight_device->props.brightness < 0) {
2256 ret = dell_backlight_device->props.brightness;
2257 goto fail_get_brightness;
2258 }
2259 backlight_update_status(dell_backlight_device);
2260 }
2261
2262 return 0;
2263
2264 fail_get_brightness:
2265 backlight_device_unregister(dell_backlight_device);
2266 fail_backlight:
2267 if (!privacy_valid)
2268 led_classdev_unregister(&micmute_led_cdev);
2269 fail_led:
2270 dell_cleanup_rfkill();
2271 fail_rfkill:
2272 platform_device_del(platform_device);
2273 fail_platform_device2:
2274 platform_device_put(platform_device);
2275 fail_platform_device1:
2276 platform_driver_unregister(&platform_driver);
2277 fail_platform_driver:
2278 return ret;
2279 }
2280

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip