All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iw: Adding helpful hints for vendor cmd
@ 2015-10-12 20:32 Ola Olsson
  2015-10-12 22:23 ` Julian Calaby
  0 siblings, 1 reply; 2+ messages in thread
From: Ola Olsson @ 2015-10-12 20:32 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ola Olsson, Ola Olsson

Without having access to the source, it was
hard to know the format of vendor oui and sub
cmd. This commit fixes that.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
---
 vendor.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/vendor.c b/vendor.c
index d0b4f9e..86c03d1 100644
--- a/vendor.c
+++ b/vendor.c
@@ -55,15 +55,19 @@ static int handle_vendor(struct nl80211_state *state,
 	FILE *file = NULL;
 
 	if (argc < 3)
-		return -EINVAL;
+		return 1;
 
 	res = sscanf(argv[0], "0x%x", &oui);
-	if (res != 1)
-		return -EINVAL;
+	if (res != 1) {
+		printf("Vendor command must start with 0x\n");
+		return 2;
+	}
 
 	res = sscanf(argv[1], "0x%x", &subcmd);
-	if (res != 1)
-		return -EINVAL;
+	if (res != 1) {
+		printf("Sub command must start with 0x\n");
+		return 2;
+	}
 
 	if (!strcmp(argv[2], "-"))
 		file = stdin;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iw: Adding helpful hints for vendor cmd
  2015-10-12 20:32 [PATCH] iw: Adding helpful hints for vendor cmd Ola Olsson
@ 2015-10-12 22:23 ` Julian Calaby
  0 siblings, 0 replies; 2+ messages in thread
From: Julian Calaby @ 2015-10-12 22:23 UTC (permalink / raw)
  To: Ola Olsson; +Cc: Johannes Berg, linux-wireless, Ola Olsson

Hi Ola,

On Tue, Oct 13, 2015 at 7:32 AM, Ola Olsson <ola1olsson@gmail.com> wrote:
> Without having access to the source, it was
> hard to know the format of vendor oui and sub
> cmd. This commit fixes that.
>
> Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
> ---
>  vendor.c |   14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/vendor.c b/vendor.c
> index d0b4f9e..86c03d1 100644
> --- a/vendor.c
> +++ b/vendor.c
> @@ -55,15 +55,19 @@ static int handle_vendor(struct nl80211_state *state,
>         FILE *file = NULL;
>
>         if (argc < 3)
> -               return -EINVAL;
> +               return 1;

You should probably explain why you're changing the return values in
the commit message.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-12 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 20:32 [PATCH] iw: Adding helpful hints for vendor cmd Ola Olsson
2015-10-12 22:23 ` Julian Calaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.