From: Tanya Brokhman <tlinder@codeaurora.org>
To: Jeremiah Mahler <jmmahler@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH 1/5] mtd: ubi: Read disturb infrastructure
Date: Mon, 29 Sep 2014 07:46:34 +0300 [thread overview]
Message-ID: <5428E42A.6090206@codeaurora.org> (raw)
In-Reply-To: <20140928181354.GB2782@hudson.localdomain>
Hi Jeremiah,
On 9/28/2014 9:13 PM, Jeremiah Mahler wrote:
> Tanya,
>
> On Sun, Sep 28, 2014 at 09:37:00AM +0300, Tanya Brokhman wrote:
>> The need for performing read disturb is determined according to new
>> statistics collected per eraseblock:
>> - read counter: incremented at each read operation
>> reset at each erase
>> - last erase time stamp: updated at each erase
>>
>> This patch adds the infrastructure for the above statistics
>>
>> Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>
>> ---
> ...
>> @@ -385,6 +402,38 @@ static ssize_t dev_attribute_show(struct device *dev,
>> return ret;
>> }
>>
>> +static ssize_t dev_attribute_store(struct device *dev,
>> + struct device_attribute *attr,
>> + const char *buf, size_t count)
>> +{
>> + int value;
>> + struct ubi_device *ubi;
>> +
>> + ubi = container_of(dev, struct ubi_device, dev);
>> + ubi = ubi_get_device(ubi->ubi_num);
>> + if (!ubi)
>> + return -ENODEV;
>> +
>> + if (kstrtos32(buf, 10, &value))
>> + return -EINVAL;
>> + /* Consider triggering full scan if threshods change */
>> + else if (attr == &dev_dt_threshold) {
>> + if (value < UBI_MAX_DT_THRESHOLD)
>> + ubi->dt_threshold = value;
>> + else
>> + pr_err("Max supported threshold value is %d",
>> + UBI_MAX_DT_THRESHOLD);
>> + } else if (attr == &dev_rd_threshold) {
>> + if (value < UBI_MAX_READCOUNTER)
>> + ubi->rd_threshold = value;
>> + else
>> + pr_err("Max supported threshold value is %d",
>> + UBI_MAX_READCOUNTER);
>> + }
>> +
>> + return count;
>> +}
>> +
> ...
>
> One small style nit. As per Documentation/CodingStyle [line 169] if
> one branch in a conditional uses braces then all branches should use
> braces.
>
I'm sorry but I understand it differently. From CodingStyle:
"This does not apply if only one branch of a conditional statement is a
single
statement; in the latter case use braces in both branches:
if (condition) {
do_this();
do_that();
} else {
otherwise();
}"
According to my understanding this doesn't mean {} should be added in
case of an if statement inside an if statement. So the above code seems
to be complaint with the coding style.
Please correct me if I'm misunderstanding something.
Thanks,
- Tanya Brokhman
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2014-09-29 4:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-28 6:37 [RFC/PATCH 1/5] mtd: ubi: Read disturb infrastructure Tanya Brokhman
2014-09-28 6:37 ` Tanya Brokhman
2014-09-28 6:37 ` Tanya Brokhman
2014-09-28 8:18 ` Richard Weinberger
2014-09-28 8:18 ` Richard Weinberger
2014-09-28 8:48 ` Tanya Brokhman
2014-09-28 8:54 ` Richard Weinberger
2014-09-28 10:46 ` Tanya Brokhman
2014-09-28 10:54 ` Richard Weinberger
2014-10-02 12:50 ` Tanya Brokhman
2014-10-02 13:24 ` Richard Weinberger
2014-10-02 13:42 ` Tanya Brokhman
2014-10-02 14:05 ` Richard Weinberger
2014-10-03 15:38 ` Artem Bityutskiy
2014-10-03 15:38 ` Artem Bityutskiy
2014-10-07 13:55 ` Richard Weinberger
2014-10-02 13:36 ` Richard Weinberger
2014-10-02 14:11 ` Tanya Brokhman
2014-09-28 12:11 ` Artem Bityutskiy
2014-09-28 12:11 ` Artem Bityutskiy
2014-09-28 14:54 ` Tanya Brokhman
2014-09-28 18:13 ` Jeremiah Mahler
2014-09-29 4:46 ` Tanya Brokhman [this message]
2014-09-29 6:49 ` Jeremiah Mahler
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=5428E42A.6090206@codeaurora.org \
--to=tlinder@codeaurora.org \
--cc=jmmahler@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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: link
Be 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.