Re: [PATCH Speakup v2] return same error value from spk_set_key_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pranay Kr. Srivastava, on mar. 21 févr. 2017 19:14:38 +0530, wrote:
> +	if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
> +		pr_debug("key_data_len = %d, SHIFT_TBL_SIZE + 4 = %d,\t"
> +			 "sizeof(spk_key_buf) = %lu\n", key_data_len,
> +			 SHIFT_TBL_SIZE + 4, sizeof(spk_key_buf));

Well, that's very technical, and not useful to an actual user :)
Rather print
			"too many key infos (%d bytes over %d)",
			key_data_len + SHIFT_TBL_SIZE + 4,
			sizeof(spk_key_buf)

> +		if (ch >= SHIFT_TBL_SIZE) {
> +			pr_debug("ch = %d, SHIFT_TBL_SIZE = %d\n", ch,
> +				 SHIFT_TBL_SIZE);

similarly, rather
			"ch %d is not a valid shift state (maximum %d)", ch, SHIFT_TBL_SIZE

> +		if (ch >= MAX_KEY) {
> +			pr_debug("ch = %d, MAX_KEY = %d\n", ch, MAX_KEY);

and
			"ch %d is not a valid keycode (maximum %d)", ch, MAX_KEY

Samuel
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux