Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7177581imm; Wed, 27 Jun 2018 22:21:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc3aQKTrKFJIEszf9JNzbMltrkYaU5orDCWjVT3wUvkwdFKAAR9qcxsGsq3Fu6I/WtAcyXM X-Received: by 2002:a62:d34a:: with SMTP id q71-v6mr3517375pfg.17.1530163310912; Wed, 27 Jun 2018 22:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530163310; cv=none; d=google.com; s=arc-20160816; b=a/jE4FzDZtBxZvEhuyysO2vQI1/t2lhVsveyPzuN9YuZ9Kfw20nYxOlQKSI9KFfKk2 Z+RLKWW64IataT5EqqYWkS4nY2kAnpL24LDPB80Q/6XDjhg4/1AiujYyEVNJBgpRLAXs /g3zmzsXoAh1LMKG8ufSxu5UwFx/1Dq7efBiwF0tiDsuJhrLqDx3N9QKbEgwOP7A/vC4 M5RXuas1N4SOyTijIvUhQkOdHKkyEhHsoSlesej8RK6VOliYKKac98on5z2QKKgpAb8Q xkCWDAFsS+X4cy1nsakFLIY1SYUuAfEDQOudqHbncmcXmLat5VOtzFxVPk28TCWTA4Hx 5ynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=l0qfrv/Dgth6OMQYg2GtUChO1qv03sjYcYdZeharIv8=; b=JKXfUANzMT3ZZWrzA7HetVi58aUSKD8uIf956ByOUoL90Q3By1GnhrLTCkv+eTPPhk Pe7TmC+cvzFbwfGFxHG4YI37GteFJkJwrRT4fEmFDmZ1ABhBG6+3afEr0+qU/PSAS8XL Z3SqpRCVpSynd3Dcg94J/j0yWEmzebvT6uw8xsBgjuWiHkf+d8WDiVpUW+PC1u4v491v lE4Lbr7upzOse1oCLqAW7/dMlhopJZa8K2IIPII1uj/8myZ741TLNAHwzEWbqaIO9EGE 7SpuZd7Edtw/87ti8qVxhJX0IN1108pTPwuZEgETWtRKZOBYBFJMuxG3I5LxazDs+xuT Vt5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=gKfKIZzl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9-v6si3797320pgs.681.2018.06.27.22.21.36; Wed, 27 Jun 2018 22:21:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=gKfKIZzl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932908AbeF1FTv (ORCPT + 99 others); Thu, 28 Jun 2018 01:19:51 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41711 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165AbeF1FTt (ORCPT ); Thu, 28 Jun 2018 01:19:49 -0400 Received: by mail-lf0-f67.google.com with SMTP id y127-v6so3202877lfc.8; Wed, 27 Jun 2018 22:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=l0qfrv/Dgth6OMQYg2GtUChO1qv03sjYcYdZeharIv8=; b=gKfKIZzlDaKMbSuqZ7iuUIE5RAvi02KuuXuNkQGWKLZZYvHiVjAZYMNSBAtiNlokCn czPt2cyLaskX+VrvYAeGcuylq7sUWug62kPzyYYGJDQF1FlLGjNy/SjGDirX73Th2+Fi UIGAksXyTBnRoNLv/yL9xm7BpLNp5U+3eie/k+wldpAgexY287x/M5p1HijTD82p2YjK 6yNTjUqVTvEGbmJ38JyRPUMk07k1qze1L3SYEu7iakAvTupX+Iq6uz+sB7sBVy4tmcCq pK5qn38X5d1nNC801cPJZLeuBfHc7HZO4k54fm+X7RWy4om0dVbUE+cKAy6/jVtn7qli Og4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=l0qfrv/Dgth6OMQYg2GtUChO1qv03sjYcYdZeharIv8=; b=eOkPd12yjX8Q6gEcl8LRZWSThDTy97K1g8Ty2u7pLi5t9V30AWhwS7MnGOhTXEE3++ qkk9/OVD79tBcCJEzTtoWiz/O55KRX6kOEzL1wzcj9XM0c35LZaMg9gzGIbDT4kjQPub g8URk+/h4rl/2SZCG/KB0+N5iw07XaLB4ZpnAd63FWn3G5h3rKYytfQMEsgiF1fRYqhq MLsRxfbW0GldpbGAHmJ1Y1gWKEvgzj8WNFM1vqD5lgKefENf6CcSX4E2AtKZTN3hCXxP a7fEUuyMBYkWzxWCEjJxPq5FkrMM9rIfEBo6qMywsmp642cgH6lXcvylKAWv9+/goPt+ c0kg== X-Gm-Message-State: APt69E3efQm5JE8t74mh5w1MRpH5gAUccHggL/I5aIJxNyJEWn7orGWK sDfoaNtzDdKTMDM9DXH6T2jJrQnK X-Received: by 2002:a19:8f10:: with SMTP id r16-v6mr983414lfd.92.1530163187544; Wed, 27 Jun 2018 22:19:47 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id s26-v6sm1122288lfi.92.2018.06.27.22.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 22:19:46 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fYPLJ-0001N5-KP; Thu, 28 Jun 2018 07:19:41 +0200 Date: Thu, 28 Jun 2018 07:19:41 +0200 From: Johan Hovold To: Sean Wang Cc: Andy Shevchenko , Mark Rutland , devicetree , Johan Hedberg , Marcel Holtmann , Linux Kernel Mailing List , linux-bluetooth@vger.kernel.org, Rob Herring , "moderated list:ARM/Mediatek SoC support" , linux-arm Mailing List Subject: Re: [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices Message-ID: <20180628051941.GF629@localhost> References: <48215a1276c36af7ad581c3d83759fe9f55e3c4b.1530004712.git.sean.wang@mediatek.com> <1530155173.29697.48.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530155173.29697.48.camel@mtkswgap22> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 11:06:13AM +0800, Sean Wang wrote: > On Wed, 2018-06-27 at 20:04 +0300, Andy Shevchenko wrote: > > On Wed, Jun 27, 2018 at 7:59 PM, Andy Shevchenko > > wrote: > > > On Wed, Jun 27, 2018 at 8:43 AM, wrote: > > >> From: Sean Wang > > >> +#include > > >> +#include > > > > >> + /* Enable the power domain and clock the device requires. */ > > >> + pm_runtime_enable(dev); > > >> + err = pm_runtime_get_sync(dev); > > >> + if (err < 0) > > >> + goto err_pm2; > > >> +err_pm1: > > >> + pm_runtime_put_sync(dev); > > >> +err_pm2: > > >> + pm_runtime_disable(dev); Please name error labels after what they do, not using numbers (see CodingStyle). Here you could use err_disable_rpm instead of err_pm2, for example. Also, if you really want to undo pm_runtime_get_sync() failing above, you still need a pm_runtime_put_noidle() to balance the usage count. > > >> +struct mtk_stp_hdr { > > >> + __u8 prefix; > > >> + __u8 dlen1:4; > > >> + __u8 type:4; > > > > >> + __u8 dlen2:8; > > >> + __u8 cs; > > >> +} __packed; Perhaps too much context have been lost here, but unless you're sharing this struct with user space, you should be using u8 (without __) above (and elsewhere). Johan