Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp765190imm; Fri, 29 Jun 2018 06:07:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpev3LL6/xYAHktiMfParhGQe7pPATQpH81Vyrkz1HH2xewmrDVRf7nJ2+ct0k8jA7b0W07V X-Received: by 2002:a17:902:7e43:: with SMTP id a3-v6mr14145512pln.151.1530277635161; Fri, 29 Jun 2018 06:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530277635; cv=none; d=google.com; s=arc-20160816; b=uvrCU8deLcP31el/qTSoik4alOaR5g9hSM2xZOuvzqPjCSufs3925dbNM77y/+VuUF p7IikCbBFIM2CDTkxkPa7Y1nHpVLvV7LZsch7UKxW58UKC+FZrIA3hs0HCeNIt51UKUf 74UsIpVo0pW8wzIEUIyxsARkOm570VelX0uYeZkX7Ha9J+1ResHOeCbWJegLzzPJyC1Z PxLMaBr/s00EmDCO6CkfXgYi6+GXEuTNCD64zGjOXc4X7dbMgaTfobQivwpR3Nbrps7S rhiSsI0ATAg1sppObOHQKpx4pzD/ANUfbCa8PDCKkeKrSV+njZVo6hFXiP0ZE79c0vvz J80A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=ZU2qw7Eab5L+nsoiRdf1MwQSGZvgJ7mNYeHJKeaBKgA=; b=Wg5ueC03YVKgpSz3C2L4E/lBYqTWKFsirgQWjRDKA7NSx9ALequ1qLlKD9/gVlkbqR 4mE3ISwrLjgoo8cTY/5ngAh8gOcVyi4dToqFSv4Z3xd0FecsH2OsTl+2YreSusy6K/EG 67LPxp3nRbcCt1fa5jV0euswZzRWKThTz5lsQtYAw6wf8oUjGBzY1UUtPAmdn7CgcRMA zAr31dUcYMxVUjl97RUunZw8Kj2IQKtGBidfPcEJABvkJmm8RIWwXqwaTOtBMluPgucg 0BKZoOeDy6naL6k/9TeD2bp1Mr8PZpRKozjfRB9aHaWFKYhq+etYxWBwDpANKSRu4LHA KZ5A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9-v6si1677287pgu.489.2018.06.29.06.06.59; Fri, 29 Jun 2018 06:07:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933746AbeF2Jrn (ORCPT + 99 others); Fri, 29 Jun 2018 05:47:43 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:49418 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753471AbeF2Jrj (ORCPT ); Fri, 29 Jun 2018 05:47:39 -0400 X-UUID: 9a9ae6b1f4834a9eabb3e1b78ce32924-20180629 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 350955493; Fri, 29 Jun 2018 17:47:33 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 29 Jun 2018 17:47:31 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 29 Jun 2018 17:47:26 +0800 Message-ID: <1530265646.6245.6.camel@mtkswgap22> Subject: Re: [PATCH v4 6/7] Bluetooth: mediatek: Add protocol support for MediaTek serial devices From: Sean Wang To: Johan Hovold CC: Andy Shevchenko , Mark Rutland , devicetree , "Johan Hedberg" , Marcel Holtmann , Linux Kernel Mailing List , , Rob Herring , "moderated list:ARM/Mediatek SoC support" , linux-arm Mailing List Date: Fri, 29 Jun 2018 17:47:26 +0800 In-Reply-To: <20180628051941.GF629@localhost> References: <48215a1276c36af7ad581c3d83759fe9f55e3c4b.1530004712.git.sean.wang@mediatek.com> <1530155173.29697.48.camel@mtkswgap22> <20180628051941.GF629@localhost> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-06-28 at 07:19 +0200, Johan Hovold wrote: > 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. > I'll give a reasonable naming for these labels and add a pm_runtime_put_noidle() in the path undoing failing pm_runtime_get_sync(). > > > >> +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). > These struct don't be shard with user space so I will turn __u8 into u8. Thanks so much for all suggestions. > Johan