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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202307012107.OW4d1gBR-lkp@intel.com>
Date:   Sat, 1 Jul 2023 22:00:53 +0800
From:   kernel test robot <lkp@...el.com>
To:     Julius Zint <julius@...t.sh>, Lee Jones <lee@...nel.org>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        Jingoo Han <jingoohan1@...il.com>
Cc:     oe-kbuild-all@...ts.linux.dev, Helge Deller <deller@....de>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-fbdev@...r.kernel.org, Julius Zint <julius@...t.sh>
Subject: Re: [PATCH 1/1] backlight: apple_bl_usb: Add Apple Studio Display
 support

Hi Julius,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-backlight/for-backlight-next]
[also build test WARNING on lee-leds/for-leds-next drm-misc/drm-misc-next drm-tip/drm-tip linus/master v6.4 next-20230630]
[cannot apply to lee-backlight/for-backlight-fixes]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Julius-Zint/backlight-apple_bl_usb-Add-Apple-Studio-Display-support/20230701-202142
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link:    https://lore.kernel.org/r/20230701120806.11812-2-julius%40zint.sh
patch subject: [PATCH 1/1] backlight: apple_bl_usb: Add Apple Studio Display support
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230701/202307012107.OW4d1gBR-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230701/202307012107.OW4d1gBR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307012107.OW4d1gBR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/video/backlight/apple_bl_usb.c:27:6: warning: no previous prototype for 'init_ctrl_msg_data' [-Wmissing-prototypes]
      27 | void init_ctrl_msg_data(struct brightness_ctrl_message_data *msg)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:33:6: warning: no previous prototype for 'set_ctrl_message_brightness' [-Wmissing-prototypes]
      33 | void set_ctrl_message_brightness(struct brightness_ctrl_message_data *msg,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:39:5: warning: no previous prototype for 'get_ctrl_message_brightness' [-Wmissing-prototypes]
      39 | u16 get_ctrl_message_brightness(struct brightness_ctrl_message_data *msg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:44:5: warning: no previous prototype for 'apple_bl_usb_usb_get_brightness' [-Wmissing-prototypes]
      44 | int apple_bl_usb_usb_get_brightness(struct usb_interface *interface,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:79:5: warning: no previous prototype for 'apple_bl_usb_usb_set_brightness' [-Wmissing-prototypes]
      79 | int apple_bl_usb_usb_set_brightness(struct usb_interface *interface,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:113:5: warning: no previous prototype for 'apple_bl_usb_check_fb' [-Wmissing-prototypes]
     113 | int apple_bl_usb_check_fb(struct backlight_device *bd, struct fb_info *info)
         |     ^~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:119:5: warning: no previous prototype for 'apple_bl_usb_get_brightness' [-Wmissing-prototypes]
     119 | int apple_bl_usb_get_brightness(struct backlight_device *bl)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:135:5: warning: no previous prototype for 'apple_bl_usb_update_status' [-Wmissing-prototypes]
     135 | int apple_bl_usb_update_status(struct backlight_device *bl)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/init_ctrl_msg_data +27 drivers/video/backlight/apple_bl_usb.c

    26	
  > 27	void init_ctrl_msg_data(struct brightness_ctrl_message_data *msg)
    28	{
    29		memset(msg, 0, sizeof(struct brightness_ctrl_message_data));
    30		msg->unknown_1 = 0x01;
    31	}
    32	
  > 33	void set_ctrl_message_brightness(struct brightness_ctrl_message_data *msg,
    34					 u16 brightness_value)
    35	{
    36		msg->brightness = cpu_to_le16(brightness_value + 400);
    37	}
    38	
  > 39	u16 get_ctrl_message_brightness(struct brightness_ctrl_message_data *msg)
    40	{
    41		return le16_to_cpu(msg->brightness) - 400;
    42	}
    43	
  > 44	int apple_bl_usb_usb_get_brightness(struct usb_interface *interface,
    45					    struct usb_device *usb_dev,
    46					    int *brightness)
    47	{
    48		int err;
    49		u16 interface_nr;
    50		int msg_data_size;
    51		struct brightness_ctrl_message_data *msg_data;
    52	
    53		msg_data_size = sizeof(struct brightness_ctrl_message_data);
    54		msg_data = kzalloc(msg_data_size, GFP_KERNEL);
    55		memset(msg_data, 0x00, msg_data_size);
    56		interface_nr = interface->cur_altsetting->desc.bInterfaceNumber;
    57	
    58		err = usb_control_msg(usb_dev,
    59				      usb_rcvctrlpipe(usb_dev, 0),
    60				      HID_GET_REPORT,
    61				      USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
    62				      /* wValue: HID-Report Type and Report ID */
    63				      HID_REPORT_TYPE_FEATURE | 0x01,
    64				      interface_nr /* wIndex */,
    65				      msg_data,
    66				      msg_data_size,
    67				      HZ);
    68		if (err < 0) {
    69			dev_err(&interface->dev,
    70				"get: usb control message err: %d\n",
    71				err);
    72		}
    73		*brightness = get_ctrl_message_brightness(msg_data);
    74		kfree(msg_data);
    75		dev_dbg(&interface->dev, "get brightness: %d\n", *brightness);
    76		return 0;
    77	}
    78	
  > 79	int apple_bl_usb_usb_set_brightness(struct usb_interface *interface,
    80					    struct usb_device *usb_dev,
    81					    int brightness)
    82	{
    83		int err;
    84		u16 interface_nr;
    85		struct brightness_ctrl_message_data *msg_data;
    86	
    87		msg_data = kzalloc(sizeof(struct brightness_ctrl_message_data), GFP_KERNEL);
    88		interface_nr = interface->cur_altsetting->desc.bInterfaceNumber;
    89		init_ctrl_msg_data(msg_data);
    90		set_ctrl_message_brightness(msg_data, brightness);
    91	
    92		err = usb_control_msg(usb_dev,
    93				      usb_sndctrlpipe(usb_dev, 0),
    94				      HID_SET_REPORT,
    95				      USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
    96				      /* wValue: HID-Report Type and Report ID */
    97				      HID_REPORT_TYPE_FEATURE | 0x01,
    98				      interface_nr /* wIndex */,
    99				      msg_data,
   100				      sizeof(struct brightness_ctrl_message_data),
   101				      HZ);
   102		kfree(msg_data);
   103		if (err < 0) {
   104			dev_err(&interface->dev,
   105				"set: usb control message err: %d\n",
   106				err);
   107			return err;
   108		}
   109		dev_dbg(&interface->dev, "set brightness: %d\n", brightness);
   110		return 0;
   111	}
   112	
 > 113	int apple_bl_usb_check_fb(struct backlight_device *bd, struct fb_info *info)
   114	{
   115		dev_info(&bd->dev, "check fb\n");
   116		return 0;
   117	}
   118	
 > 119	int apple_bl_usb_get_brightness(struct backlight_device *bl)
   120	{
   121		int ret;
   122		struct apple_bl_usb_data *data;
   123		int hw_brightness;
   124	
   125		data = bl_get_data(bl);
   126		ret = apple_bl_usb_usb_get_brightness(data->usb_interface,
   127						      data->usb_dev,
   128						      &hw_brightness);
   129		if (!ret)
   130			ret = hw_brightness;
   131	
   132		return ret;
   133	}
   134	
 > 135	int apple_bl_usb_update_status(struct backlight_device *bl)
   136	{
   137		int err;
   138		struct apple_bl_usb_data *data;
   139	
   140		data = bl_get_data(bl);
   141		err = apple_bl_usb_usb_set_brightness(data->usb_interface,
   142						      data->usb_dev,
   143						      bl->props.brightness);
   144		return err;
   145	}
   146	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ