lkml.org 
[lkml]   [2019]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] Input: add Apple SPI keyboard and trackpad driver.
Hi Ronald,

Thank you for the patch! Perhaps something to improve:

url: https://github.com/0day-ci/linux/commits/Ronald-Tschal-r/drm-bridge-sil_sii8620-depend-on-INPUT-instead-of-selecting-it/20190205-003319
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next

smatch warnings:
drivers/input/keyboard/applespi.c:1551 applespi_get_saved_bl_level() warn: returning -1 instead of -ENOMEM is sloppy

# https://github.com/0day-ci/linux/commit/cfa9f37054a5b21113aa8b00c455275145114f8e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout cfa9f37054a5b21113aa8b00c455275145114f8e
vim +1551 drivers/input/keyboard/applespi.c

cfa9f3705 Ronald Tschalär 2019-02-04 1541
cfa9f3705 Ronald Tschalär 2019-02-04 1542 static int applespi_get_saved_bl_level(void)
cfa9f3705 Ronald Tschalär 2019-02-04 1543 {
cfa9f3705 Ronald Tschalär 2019-02-04 1544 struct efivar_entry *efivar_entry;
cfa9f3705 Ronald Tschalär 2019-02-04 1545 u16 efi_data = 0;
cfa9f3705 Ronald Tschalär 2019-02-04 1546 unsigned long efi_data_len;
cfa9f3705 Ronald Tschalär 2019-02-04 1547 int sts;
cfa9f3705 Ronald Tschalär 2019-02-04 1548
cfa9f3705 Ronald Tschalär 2019-02-04 1549 efivar_entry = kmalloc(sizeof(*efivar_entry), GFP_KERNEL);
cfa9f3705 Ronald Tschalär 2019-02-04 1550 if (!efivar_entry)
cfa9f3705 Ronald Tschalär 2019-02-04 @1551 return -1;
cfa9f3705 Ronald Tschalär 2019-02-04 1552
cfa9f3705 Ronald Tschalär 2019-02-04 1553 memcpy(efivar_entry->var.VariableName, EFI_BL_LEVEL_NAME,
cfa9f3705 Ronald Tschalär 2019-02-04 1554 sizeof(EFI_BL_LEVEL_NAME));
cfa9f3705 Ronald Tschalär 2019-02-04 1555 efivar_entry->var.VendorGuid = EFI_BL_LEVEL_GUID;
cfa9f3705 Ronald Tschalär 2019-02-04 1556 efi_data_len = sizeof(efi_data);
cfa9f3705 Ronald Tschalär 2019-02-04 1557
cfa9f3705 Ronald Tschalär 2019-02-04 1558 sts = efivar_entry_get(efivar_entry, NULL, &efi_data_len, &efi_data);
cfa9f3705 Ronald Tschalär 2019-02-04 1559 if (sts && sts != -ENOENT)
cfa9f3705 Ronald Tschalär 2019-02-04 1560 pr_warn("Error getting backlight level from EFI vars: %d\n",
cfa9f3705 Ronald Tschalär 2019-02-04 1561 sts);
cfa9f3705 Ronald Tschalär 2019-02-04 1562
cfa9f3705 Ronald Tschalär 2019-02-04 1563 kfree(efivar_entry);
cfa9f3705 Ronald Tschalär 2019-02-04 1564
cfa9f3705 Ronald Tschalär 2019-02-04 1565 return efi_data;
cfa9f3705 Ronald Tschalär 2019-02-04 1566 }
cfa9f3705 Ronald Tschalär 2019-02-04 1567

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

\
 
 \ /
  Last update: 2019-02-05 11:22    [W:0.113 / U:14.220 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site