Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1533807ybt; Mon, 15 Jun 2020 02:49:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqMBREgXlr1d9SH54gbBsSSJFNgFrD5MTXI7KW4Rn4foxrtXO23cArK4T7Lmf71dOl63zI X-Received: by 2002:a17:906:3951:: with SMTP id g17mr25685733eje.414.1592214552912; Mon, 15 Jun 2020 02:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592214552; cv=none; d=google.com; s=arc-20160816; b=nsYX83E57lXB8EWekqXyBgTqwhCiIH15OrYT8MnBDvwVVzpXRU1J+1cqjOJo5qHKhL 9lxc/14WpGiWw6BnQ2RZLjfbmdtfD3Bg0lGN1NaAyJJUXXAevxcDyjRBr400fBat+akH Vmc7Qle61Sm1gdPz41a1H8jzq+jtz7SxvOUIU5hnHwF+VBV2sUnALjycHmEdPVfEDQJX KBK+AGy+dkcpWALbIoQu0kD8v5bEoLZR/ezUApkHoaufMha/EUzYNuLqI/8jK22Z0FhV 8BkKWE6HM0zTog7mAdRNC4T2UYF+puwVhtaA+IWneaR82LoUD0UY/RYeNkznXZOrGy/s edUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:to:from :dkim-signature; bh=mVj0FOxmN6qSzZwF0D8yFWm1/gWv6RuE/e+w/ay5bOo=; b=yRCTVJqITYo/1Qxh2DcAb+HJPTe/UFfFOmHncEXV87FOqHpX6d4QUAeFnj0fKgA/Va kdkkdv5IUt7cJtSl3Ol9J0mvkV6hWsvKv39MYZ4BbHEMhOPXDtbp3B/xsa68NNIxbGUl +nLqiJiXj+E/TaGylz6bn4d8yh+ugy1OHO4KgugWUGU0QJqkBmXw1ThM4B9C+4j8//FJ AtNa2CkMO2eNRvvK/1c9gpEXDl/+16jpIi4AqNX+WMXcbaJCDcNWB0DKf3tHuf+VuZbS //XcQt/IULhu/V3WvS7iw3W2pbtPRdyoVaKfrdkBrlvb86XTWkRZR+dxOs0jf//aQojr X68A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=YMFmdOj5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm12si7953041edb.565.2020.06.15.02.48.35; Mon, 15 Jun 2020 02:49:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=YMFmdOj5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728505AbgFOJse (ORCPT + 99 others); Mon, 15 Jun 2020 05:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728369AbgFOJsd (ORCPT ); Mon, 15 Jun 2020 05:48:33 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26F6CC061A0E for ; Mon, 15 Jun 2020 02:48:33 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id g2so1528671lfb.0 for ; Mon, 15 Jun 2020 02:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:organization:in-reply-to:references :mime-version:content-transfer-encoding; bh=mVj0FOxmN6qSzZwF0D8yFWm1/gWv6RuE/e+w/ay5bOo=; b=YMFmdOj5Q1+LaIGBL2uBeUdUGJVdTWiigw7BA4m/4mwJh5FLMbG6G0ikX7Gf37ASx6 MlpkNqoVV+IZo38iu3S+PwpPlXrDhYxd6wsloOT3CKt7MsqneQ0eaU/BYTRc8HQhA0Uh 2k0lZlddZ+OV8bnNcr1GyAEbKcJEeI66l4baRhjcNcL4eMBGHL+hJIPLtVcHY6QbA7bC bLGcmzhdtuJaJYCOg/MLIYWop0dtla2RGgfnPZFvz3lsk9oxhw6zFGZLWyH2VoMmUfWJ WGUMiWElxawvNDa7kvGt0LVCNcNY42VYXR+kH5ST6cg4Qp6JdaNIt9sC74o4CD4kecO2 UpLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:organization :in-reply-to:references:mime-version:content-transfer-encoding; bh=mVj0FOxmN6qSzZwF0D8yFWm1/gWv6RuE/e+w/ay5bOo=; b=ZHOLEntoK3J4A1n0PwizlBC09GoKKGvNTgUv1zO5UG+W+HXbRbGU4hqufH7iRdbR8u QRtvBhdWayFaO6rDr7GgIaIrw6oLqX3P1LQRzmFFOlovfwb2t/uiozsDEyLylu/vD7s+ +wOw1zHMHPrvbm5apU1O3ePqey0DTdUOcLrtZRJ9XJO1OgTSaqq0odeU5weR8zUOyI53 2WQQhTmqaW5wNe+Utuzz1CEtmcJ0CouOoLxQYgrXzSsVWWYGUaMeaIrOlTDpQgOq/nYc GZTEUVAL60imFz3TlxYJgU2Lso2vSLgrgN8CNq1OQMqshaapb7gL1G8vEN1cLZKuaC4j ecTQ== X-Gm-Message-State: AOAM530B7fZTpUEHlbol5faKAxhFSsZzUeS2mNusUSWYgaJtqenp1Zsw lbH9e4rg9N9FN83pWfi94rj6ebzqDDw= X-Received: by 2002:ac2:521a:: with SMTP id a26mr197884lfl.192.1592214511219; Mon, 15 Jun 2020 02:48:31 -0700 (PDT) Received: from ix.localnet ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id l14sm3727139lja.2.2020.06.15.02.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 02:48:30 -0700 (PDT) From: Szymon Janc To: linux-bluetooth@vger.kernel.org, Luiz Augusto von Dentz , Pali =?ISO-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH] sap: Improve error messages Date: Mon, 15 Jun 2020 11:48:20 +0200 Message-ID: <4237143.LvFx2qVVIh@ix> Organization: CODECOUP In-Reply-To: <20200604232433.4951-1-pali@kernel.org> References: <20200604232433.4951-1-pali@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Friday, 5 June 2020 01:24:33 CEST Pali Roh=E1r wrote: > When bluetoohd daemon is starting, it prints following error messages: >=20 > bluetoothd[19117]: profiles/sap/server.c:sap_server_register() Sap driver > initialization failed. bluetoothd[19117]: sap-server: Operation not > permitted (1) >=20 > Initialization is failing because sap server is enabled only when > bluetoothd daemon is started with --experimental option. >=20 > And "Operation not permitted" is result of returning error code -1. >=20 > This patch improves error messages. When --experimental option is not used > then bluetoothd prints more explaining error message. And in case function > sap_init() fails then -EOPNOTSUPP "Operation not supported" is returned > instead of -EPERM (-1). > --- > profiles/sap/server.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/profiles/sap/server.c b/profiles/sap/server.c > index 5de682a33..99ff80297 100644 > --- a/profiles/sap/server.c > +++ b/profiles/sap/server.c > @@ -1353,9 +1353,14 @@ int sap_server_register(struct btd_adapter *adapte= r) > GIOChannel *io; > struct sap_server *server; >=20 > + if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) { > + error("Sap driver is disabled without --experimental=20 option"); > + return -EOPNOTSUPP; > + } > + Maybe just make sap_init() fail if experimental is not enabled in sap-dummy= =2Ec? This driver is usable only for profile qualification tests and nothing more. And TBH I'm not sure why distros are enabling SAP in first place... > if (sap_init() < 0) { > error("Sap driver initialization failed."); > - return -1; > + return -EOPNOTSUPP; > } >=20 > record =3D create_sap_record(SAP_SERVER_CHANNEL); =2D-=20 pozdrawiam Szymon Janc