From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B64B3C432C1 for ; Tue, 24 Sep 2019 15:44:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85D582146E for ; Tue, 24 Sep 2019 15:44:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uIGSMzv3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="N59VSQNO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85D582146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4X2IV1jilnyPnDxuKjxn/Y1XGTx6eJrayxvR4omRFEg=; b=uIGSMzv3lN/jKV l8bSnY43Wihm8YWFvFM4AkWELiJES7iyOnI17Xp9UXxAf+H89/8fZhHTIXQ8rJaEyhVxkr1uN8OgK pYxQdP+ppQ/8Rg23a0JPW6vi6Qqr7MEF0jvqbbjZW7rydezwUtQv/lMhzXF/hpdtNVOeGmX+oaZFJ Y92KMorfcuDzRMQqnEISX0tOIek5Ikgx+PyHzW7gGE1uBXLaJvS7JhxjB7cUJ2TD337HSXZ3oIvhK 1IiEeOP8PFPmUv5qT9RdZ5VIt8HFtx+MGkE58dEM9/6AM/3QlJXbjhT1xYl+wsU27vvdmMQ90uz+L A/km25AlvKxDCRHeFPgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCmzR-0005nc-A1; Tue, 24 Sep 2019 15:44:33 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCmzO-0005mw-Ak for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2019 15:44:31 +0000 Received: by mail-pf1-x443.google.com with SMTP id a2so1591806pfo.10 for ; Tue, 24 Sep 2019 08:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FRqhU1AihYJ2QqMEDa4hoNnJ00l/92NY2n3WTvQE51k=; b=N59VSQNOtKoruFGih+9OfLHlJDZghgi0SHzvbDJnCjmSJNCbKIz4xT3qDUWkkpVZuO ur7WnjtgGzFrGmmpJRPHZwLXT4NhVxGKX3IkxFpKapUI/PEIpDJaXgVZz4Px4iE8fDDh dOcpxkfz0wQxC/P5g5kJaBwjLMrBhJMwany9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FRqhU1AihYJ2QqMEDa4hoNnJ00l/92NY2n3WTvQE51k=; b=Fu5h1iJMo1gfApH4iynaAdlSFP1xpnKVxW/t5Z2ywu7EGrlIseE+2LJ0qfEphGljvk qlbrYVEMRM2AbtqhVm4e7b8fMubbHJ63P72W+JZYuY7yQcjfVVrC9u0x+Ehr3NmVpOfL BSbrVuBw8tdIHy3/EFNyOfH9wad4tggO6kMG/0+zH8zaj63A0g6nIFp0v6A6YfLs6F02 ftEeBAuPU+ir1l7h6hbz4jWKkCGYN5WOdNS2JphSGpQ+Q7Ezq/RVFsxg5Gd6BZiJUmke 8XFirrdXZ+NWjx6oT+uaErPBGh8/EnBB+/OjNvd38j0qAUclPSnRLHT5BuHSy+iJDBRo ihKQ== X-Gm-Message-State: APjAAAXpzCKhAHzyFMnU77d84vGigmtKW9+uN5qG6SdUT+69JEpBIPYZ 8Q7YwYwE5vc5Wr2/DofMTY+Q+Q== X-Google-Smtp-Source: APXvYqyy/dekHqlB0kdPWKwq8sUxNkiNic4QkQj9ZSqM6+zm9tsd2AmEmoeo9mAVn3VjMCVJaICECQ== X-Received: by 2002:a63:531d:: with SMTP id h29mr3906627pgb.52.1569339868740; Tue, 24 Sep 2019 08:44:28 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id q13sm321184pjq.0.2019.09.24.08.44.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2019 08:44:26 -0700 (PDT) Date: Tue, 24 Sep 2019 08:44:24 -0700 From: Matthias Kaehlcke To: Leonard Crestez Subject: Re: [PATCH] PM / devfreq: Lock devfreq in trans_stat_show Message-ID: <20190924154424.GI133864@google.com> References: <714675448e7fbf3c930b0dca6fbe54fa5f87211b.1569256001.git.leonard.crestez@nxp.com> <979d107f-0a52-3aa4-a397-acb0ff754a3c@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190924_084430_398343_204B3A84 X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artur =?utf-8?B?xZp3aWdvxYQ=?= , "linux-pm@vger.kernel.org" , Krzysztof Kozlowski , Lukasz Luba , Chanwoo Choi , Kyungmin Park , MyungJoo Ham , dl-linux-imx , Georgi Djakov , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 24, 2019 at 07:44:16AM +0000, Leonard Crestez wrote: > On 2019-09-24 5:07 AM, Chanwoo Choi wrote: > >> @@ -1507,16 +1508,22 @@ static ssize_t trans_stat_show(struct device *dev, > >> struct devfreq *devfreq = to_devfreq(dev); > >> ssize_t len; > >> int i, j; > >> unsigned int max_state = devfreq->profile->max_state; > >> > >> - if (!devfreq->stop_polling && > >> - devfreq_update_status(devfreq, devfreq->previous_freq)) > >> - return 0; > >> if (max_state == 0) > >> return sprintf(buf, "Not Supported.\n"); > >> > >> + /* lock and update */ > > > > It is not necessary. Anyone can know that this code is related to mutex lock/unlock. > > OK. You're the second person to mention this but it's quite strange to > see objections raised against comments. Comments are great if they add value, in this case the comment is stating the obvious, which IMO just adds noise to the code. The coding style guidelines also briefly touch this topic: 8) Commenting ------------- Comments are good, but there is also a danger of over-commenting. Documentation/process/coding-style.rst _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel