From: Greg KH <gregkh@linuxfoundation.org>
To: Dongdong Yang <contribute.kernel@gmail.com>
Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
linux-pm@vger.kernel.org, yangdongdong@xiaomi.com,
tanggeliang@xiaomi.com, taojun@xiaomi.com, huangqiwu@xiaomi.com,
rocking@linux.alibaba.com, fengwei@xiaomi.com,
zhangguoquan@xiaomi.com, gulinghua@xiaomi.com, duhui@xiaomi.com
Subject: Re: [PATCH v2] sched: Provide USF for the portable equipment.
Date: Fri, 31 Jul 2020 15:22:07 +0200 [thread overview]
Message-ID: <20200731132207.GB1712190@kroah.com> (raw)
In-Reply-To: <e992fea6ad249694e615640862a28346936f8844.1596196062.git.yangdongdong@xiaomi.com>
On Fri, Jul 31, 2020 at 08:46:30PM +0800, Dongdong Yang wrote:
> --- /dev/null
> +++ b/drivers/staging/fbsched/usf.c
> @@ -0,0 +1,346 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2020 XiaoMi Inc.
> + * Author: Yang Dongdong <yangdongdong@xiaomi.com>
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + * See http://www.gnu.org/licenses/gpl-2.0.html for more details.
Please remove the license "boilerplate" text as you have the SPDX line
on top.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/kthread.h>
> +#include <linux/cpu.h>
> +#include <linux/sysfs.h>
> +#include <linux/kthread.h>
> +#include <linux/kobject.h>
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/kallsyms.h>
> +#include <linux/debugfs.h>
> +#include <linux/fb.h>
> +#include <linux/notifier.h>
> +
> +#define BOOST_MIN_V -100
> +#define BOOST_MAX_V 100
> +#define LEVEL_TOP 3
> +
> +#define USF_TAG "[usf_sched]"
> +
> +DEFINE_PER_CPU(unsigned long[PID_MAX_LIMIT], task_hist_nivcsw);
> +
> +static struct {
> + bool is_sched_usf_enabled;
> + int enable_debug;
> + int is_screen_on;
> + struct kobject *kobj;
A raw kobject? For a driver? are you _SURE_???
> + struct dentry *debugfs_entry;
Why do you need this?
> + usf_vdev.enable_debug = 0;
> + usf_vdev.debugfs_entry = debugfs_create_file("usf_dbg",
> + 0660, NULL, NULL,
> + &usf_dbg_fops);
> + if (!usf_vdev.debugfs_entry)
> + pr_err("Failed to create usf_dbg!\n");
How can that value be NULL?
There is no need to check debugfs functions for error values.
But in this case, why are you writing a single file to the root of
debugfs? Why not put it in a directory instead? That would be much
nicer, don't you think?
thanks,
greg k-h
next prev parent reply other threads:[~2020-07-31 13:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 12:46 [PATCH v2] Provide USF for the portable equipment Dongdong Yang
2020-07-31 12:46 ` [PATCH v2] sched: " Dongdong Yang
2020-07-31 13:20 ` Greg KH
2020-07-31 13:22 ` Greg KH [this message]
2020-07-31 13:28 ` Greg KH
2020-07-31 14:25 ` Dietmar Eggemann
2020-08-01 8:13 ` [PATCH v2] " Christoph Hellwig
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=20200731132207.GB1712190@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bsegall@google.com \
--cc=contribute.kernel@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=dietmar.eggemann@arm.com \
--cc=duhui@xiaomi.com \
--cc=fengwei@xiaomi.com \
--cc=gulinghua@xiaomi.com \
--cc=huangqiwu@xiaomi.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=rocking@linux.alibaba.com \
--cc=rostedt@goodmis.org \
--cc=tanggeliang@xiaomi.com \
--cc=taojun@xiaomi.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=yangdongdong@xiaomi.com \
--cc=zhangguoquan@xiaomi.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox