[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170221122407.re5zby44cdhvfy46@var.youpi.perso.aquilenet.fr>
Date: Tue, 21 Feb 2017 13:24:07 +0100
From: Samuel Thibault <samuel.thibault@...-lyon.org>
To: "Pranay Kr. Srivastava" <pranjas@...il.com>
Cc: w.d.hubbs@...il.com, chris@...-brannons.com, kirk@...sers.ca,
gregkh@...uxfoundation.org, sfr@...b.auug.org.au,
speakup@...ux-speakup.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] return same error value from spk_set_key_info
Pranay Kr. Srivastava, on mar. 21 févr. 2017 17:24:42 +0530, wrote:
> Retain the previous error values as debug messages
> instead.
Well, they are not really useful because they are actually undocumented.
> + if (version != KEY_MAP_VER) {
> + pr_debug("Version mismatch %d\n", -1);
Rather print version and KEY_MAP_VER
> + if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
> + pr_debug("Data len and Shift table too big %d\n", -2);
Rather print key_data_len + SHIFT_TBL_SIZE + 4 and sizeof(spk_key_buf)
> + if (ch >= SHIFT_TBL_SIZE) {
> + pr_debug("Key table size overflow %d\n", -3);
Rather print ch and SHIFT_TBL_SIZE.
> + if (ch >= MAX_KEY) {
> + pr_debug("Max Key overflow %d\n", -4);
Rather print ch and MAX_KEY.
Apart from that, returning -EINVAL instead of different values is fine
for me.
Samuel
Powered by blists - more mailing lists