linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] device: Return error when ConnectProfile DBus method fails (second fix)
@ 2020-04-26 21:02 Pali Rohár
  2020-04-26 21:06 ` bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pali Rohár @ 2020-04-26 21:02 UTC (permalink / raw)
  To: linux-bluetooth

This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is
another place which needs to distinguish between Connect and ConnectProfile
DBus method.
---
 src/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 229579378..7b0eb256e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 	dev->pending = create_pending_list(dev, uuid);
 	if (!dev->pending) {
 		if (dev->svc_refreshed) {
-			if (find_service_with_state(dev->services,
+			if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
+							"Connect") &&
+				find_service_with_state(dev->services,
 						BTD_SERVICE_STATE_CONNECTED))
 				return dbus_message_new_method_return(msg);
 			else
-- 
2.20.1


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

* RE: device: Return error when ConnectProfile DBus method fails (second fix)
  2020-04-26 21:02 [PATCH] device: Return error when ConnectProfile DBus method fails (second fix) Pali Rohár
@ 2020-04-26 21:06 ` bluez.test.bot
  2020-04-27 16:44 ` [PATCH] " Luiz Augusto von Dentz
  2020-05-03 11:10 ` [PATCH v2] " Pali Rohár
  2 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2020-04-26 21:06 UTC (permalink / raw)
  To: linux-bluetooth, pali

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]


This is automated email and please do not replay to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.


Test Result:
Checkpatch Failed

Patch Title:
device: Return error when ConnectProfile DBus method fails (second fix)

Output:
ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 3aa815a31017 ("device: Return error when ConnectProfile DBus method fails")'
#7: 
This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is

- total: 1 errors, 0 warnings, 10 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.



For more details about BlueZ coding style guide, please find it
in doc/coding-style.txt

---
Regards,
Linux Bluetooth

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

* Re: [PATCH] device: Return error when ConnectProfile DBus method fails (second fix)
  2020-04-26 21:02 [PATCH] device: Return error when ConnectProfile DBus method fails (second fix) Pali Rohár
  2020-04-26 21:06 ` bluez.test.bot
@ 2020-04-27 16:44 ` Luiz Augusto von Dentz
  2020-04-27 18:14   ` Pali Rohár
  2020-05-03 11:10 ` [PATCH v2] " Pali Rohár
  2 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2020-04-27 16:44 UTC (permalink / raw)
  To: Pali Rohár; +Cc: linux-bluetooth

Hi Pali,

On Sun, Apr 26, 2020 at 2:05 PM Pali Rohár <pali@kernel.org> wrote:
>
> This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is
> another place which needs to distinguish between Connect and ConnectProfile
> DBus method.
> ---
>  src/device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index 229579378..7b0eb256e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
>         dev->pending = create_pending_list(dev, uuid);
>         if (!dev->pending) {
>                 if (dev->svc_refreshed) {
> -                       if (find_service_with_state(dev->services,
> +                       if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
> +                                                       "Connect") &&
> +                               find_service_with_state(dev->services,
>                                                 BTD_SERVICE_STATE_CONNECTED))

Perhaps it would be better to have a helper function that checks this for us.

>                                 return dbus_message_new_method_return(msg);
>                         else
> --
> 2.20.1
>


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH] device: Return error when ConnectProfile DBus method fails (second fix)
  2020-04-27 16:44 ` [PATCH] " Luiz Augusto von Dentz
@ 2020-04-27 18:14   ` Pali Rohár
  0 siblings, 0 replies; 6+ messages in thread
From: Pali Rohár @ 2020-04-27 18:14 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

On Monday 27 April 2020 09:44:50 Luiz Augusto von Dentz wrote:
> Hi Pali,
> 
> On Sun, Apr 26, 2020 at 2:05 PM Pali Rohár <pali@kernel.org> wrote:
> >
> > This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is
> > another place which needs to distinguish between Connect and ConnectProfile
> > DBus method.
> > ---
> >  src/device.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/device.c b/src/device.c
> > index 229579378..7b0eb256e 100644
> > --- a/src/device.c
> > +++ b/src/device.c
> > @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
> >         dev->pending = create_pending_list(dev, uuid);
> >         if (!dev->pending) {
> >                 if (dev->svc_refreshed) {
> > -                       if (find_service_with_state(dev->services,
> > +                       if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
> > +                                                       "Connect") &&
> > +                               find_service_with_state(dev->services,
> >                                                 BTD_SERVICE_STATE_CONNECTED))
> 
> Perhaps it would be better to have a helper function that checks this for us.

I do not know if it helps, but I think this is the last problem which I
observed with connect/disconnect profile method.

> >                                 return dbus_message_new_method_return(msg);
> >                         else
> > --
> > 2.20.1
> >
> 
> 
> -- 
> Luiz Augusto von Dentz

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

* [PATCH v2] device: Return error when ConnectProfile DBus method fails (second fix)
  2020-04-26 21:02 [PATCH] device: Return error when ConnectProfile DBus method fails (second fix) Pali Rohár
  2020-04-26 21:06 ` bluez.test.bot
  2020-04-27 16:44 ` [PATCH] " Luiz Augusto von Dentz
@ 2020-05-03 11:10 ` Pali Rohár
  2020-05-04 23:38   ` Luiz Augusto von Dentz
  2 siblings, 1 reply; 6+ messages in thread
From: Pali Rohár @ 2020-05-03 11:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Luiz Augusto von Dentz

This is fixup of commit 3aa815a31017 ("device: Return error when
ConnectProfile DBus method fails"). There is another place which needs
to distinguish between Connect and ConnectProfile DBus method.
---
 src/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 229579378..7b0eb256e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 	dev->pending = create_pending_list(dev, uuid);
 	if (!dev->pending) {
 		if (dev->svc_refreshed) {
-			if (find_service_with_state(dev->services,
+			if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
+							"Connect") &&
+				find_service_with_state(dev->services,
 						BTD_SERVICE_STATE_CONNECTED))
 				return dbus_message_new_method_return(msg);
 			else
-- 
2.20.1


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

* Re: [PATCH v2] device: Return error when ConnectProfile DBus method fails (second fix)
  2020-05-03 11:10 ` [PATCH v2] " Pali Rohár
@ 2020-05-04 23:38   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-04 23:38 UTC (permalink / raw)
  To: Pali Rohár; +Cc: linux-bluetooth

Hi Pali,

On Sun, May 3, 2020 at 4:11 AM Pali Rohár <pali@kernel.org> wrote:
>
> This is fixup of commit 3aa815a31017 ("device: Return error when
> ConnectProfile DBus method fails"). There is another place which needs
> to distinguish between Connect and ConnectProfile DBus method.
> ---
>  src/device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index 229579378..7b0eb256e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
>         dev->pending = create_pending_list(dev, uuid);
>         if (!dev->pending) {
>                 if (dev->svc_refreshed) {
> -                       if (find_service_with_state(dev->services,
> +                       if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
> +                                                       "Connect") &&
> +                               find_service_with_state(dev->services,
>                                                 BTD_SERVICE_STATE_CONNECTED))
>                                 return dbus_message_new_method_return(msg);
>                         else
> --
> 2.20.1

Applied, thanks.


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2020-05-04 23:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 21:02 [PATCH] device: Return error when ConnectProfile DBus method fails (second fix) Pali Rohár
2020-04-26 21:06 ` bluez.test.bot
2020-04-27 16:44 ` [PATCH] " Luiz Augusto von Dentz
2020-04-27 18:14   ` Pali Rohár
2020-05-03 11:10 ` [PATCH v2] " Pali Rohár
2020-05-04 23:38   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).