From: Matthias Kaehlcke <mka@chromium.org> To: Leonard Crestez <leonard.crestez@nxp.com> Cc: "Chanwoo Choi" <cw00.choi@samsung.com>, "MyungJoo Ham" <myungjoo.ham@samsung.com>, "Kyungmin Park" <kyungmin.park@samsung.com>, "Artur Świgoń" <a.swigon@partner.samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>, "Georgi Djakov" <georgi.djakov@linaro.org>, "Lukasz Luba" <l.luba@partner.samsung.com>, dl-linux-imx <linux-imx@nxp.com>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH] PM / devfreq: Lock devfreq in trans_stat_show Date: Tue, 24 Sep 2019 08:44:24 -0700 [thread overview] Message-ID: <20190924154424.GI133864@google.com> (raw) In-Reply-To: <VI1PR04MB7023BF1AD2C61C8A5ABAD5FEEE840@VI1PR04MB7023.eurprd04.prod.outlook.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Matthias Kaehlcke <mka@chromium.org> To: Leonard Crestez <leonard.crestez@nxp.com> Cc: "Artur Świgoń" <a.swigon@partner.samsung.com>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, "Krzysztof Kozlowski" <krzk@kernel.org>, "Lukasz Luba" <l.luba@partner.samsung.com>, "Chanwoo Choi" <cw00.choi@samsung.com>, "Kyungmin Park" <kyungmin.park@samsung.com>, "MyungJoo Ham" <myungjoo.ham@samsung.com>, dl-linux-imx <linux-imx@nxp.com>, "Georgi Djakov" <georgi.djakov@linaro.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH] PM / devfreq: Lock devfreq in trans_stat_show Date: Tue, 24 Sep 2019 08:44:24 -0700 [thread overview] Message-ID: <20190924154424.GI133864@google.com> (raw) In-Reply-To: <VI1PR04MB7023BF1AD2C61C8A5ABAD5FEEE840@VI1PR04MB7023.eurprd04.prod.outlook.com> 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
next prev parent reply other threads:[~2019-09-24 15:44 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20190923162736epcas3p2c1db3bf767a07f17b609bc91fbbd9648@epcas3p2.samsung.com> 2019-09-23 16:27 ` [PATCH] PM / devfreq: Lock devfreq in trans_stat_show Leonard Crestez 2019-09-23 16:27 ` Leonard Crestez 2019-09-23 18:54 ` Matthias Kaehlcke 2019-09-23 18:54 ` Matthias Kaehlcke 2019-09-23 23:34 ` Matthias Kaehlcke 2019-09-23 23:34 ` Matthias Kaehlcke 2019-09-24 2:11 ` Chanwoo Choi 2019-09-24 2:11 ` Chanwoo Choi 2019-09-24 7:44 ` Leonard Crestez 2019-09-24 7:44 ` Leonard Crestez 2019-09-24 15:44 ` Matthias Kaehlcke [this message] 2019-09-24 15:44 ` Matthias Kaehlcke 2019-09-25 1:21 ` Chanwoo Choi 2019-09-25 1:21 ` Chanwoo Choi 2019-09-25 19:36 ` Leonard Crestez 2019-09-25 19:36 ` Leonard Crestez
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190924154424.GI133864@google.com \ --to=mka@chromium.org \ --cc=a.swigon@partner.samsung.com \ --cc=cw00.choi@samsung.com \ --cc=georgi.djakov@linaro.org \ --cc=krzk@kernel.org \ --cc=kyungmin.park@samsung.com \ --cc=l.luba@partner.samsung.com \ --cc=leonard.crestez@nxp.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-imx@nxp.com \ --cc=linux-pm@vger.kernel.org \ --cc=myungjoo.ham@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.