2020-11-12 07:11:14

by Luo Jiaxing

[permalink] [raw]
Subject: [PATCH v4 5/5] drm/i915/display: Introduce DEFINE_SHOW_STORE_ATTRIBUTE for debugfs

Seq introduce a new helper macro DEFINE_SHOW_STORE_ATTRIBUTE for
Read-Write file, so we apply it at drm/i915/display to reduce some
duplicated code.

Signed-off-by: Luo Jiaxing <[email protected]>
---
.../gpu/drm/i915/display/intel_display_debugfs.c | 55 ++--------------------
1 file changed, 4 insertions(+), 51 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 0bf31f9..8bf839f 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -1329,21 +1329,7 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
return 0;
}

-static int i915_displayport_test_active_open(struct inode *inode,
- struct file *file)
-{
- return single_open(file, i915_displayport_test_active_show,
- inode->i_private);
-}
-
-static const struct file_operations i915_displayport_test_active_fops = {
- .owner = THIS_MODULE,
- .open = i915_displayport_test_active_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- .write = i915_displayport_test_active_write
-};
+DEFINE_SHOW_STORE_ATTRIBUTE(i915_displayport_test_active);

static int i915_displayport_test_data_show(struct seq_file *m, void *data)
{
@@ -1733,19 +1719,7 @@ static ssize_t i915_hpd_storm_ctl_write(struct file *file,
return len;
}

-static int i915_hpd_storm_ctl_open(struct inode *inode, struct file *file)
-{
- return single_open(file, i915_hpd_storm_ctl_show, inode->i_private);
-}
-
-static const struct file_operations i915_hpd_storm_ctl_fops = {
- .owner = THIS_MODULE,
- .open = i915_hpd_storm_ctl_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- .write = i915_hpd_storm_ctl_write
-};
+DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_storm_ctl);

static int i915_hpd_short_storm_ctl_show(struct seq_file *m, void *data)
{
@@ -1811,14 +1785,7 @@ static ssize_t i915_hpd_short_storm_ctl_write(struct file *file,
return len;
}

-static const struct file_operations i915_hpd_short_storm_ctl_fops = {
- .owner = THIS_MODULE,
- .open = i915_hpd_short_storm_ctl_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- .write = i915_hpd_short_storm_ctl_write,
-};
+DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);

static int i915_drrs_ctl_set(void *data, u64 val)
{
@@ -2181,21 +2148,7 @@ static ssize_t i915_dsc_fec_support_write(struct file *file,
return len;
}

-static int i915_dsc_fec_support_open(struct inode *inode,
- struct file *file)
-{
- return single_open(file, i915_dsc_fec_support_show,
- inode->i_private);
-}
-
-static const struct file_operations i915_dsc_fec_support_fops = {
- .owner = THIS_MODULE,
- .open = i915_dsc_fec_support_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- .write = i915_dsc_fec_support_write
-};
+DEFINE_SHOW_STORE_ATTRIBUTE(i915_dsc_fec_support);

/**
* intel_connector_debugfs_add - add i915 specific connector debugfs files
--
2.7.4


2020-11-13 11:30:46

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH v4 5/5] drm/i915/display: Introduce DEFINE_SHOW_STORE_ATTRIBUTE for debugfs

Hi Luo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next linus/master v5.10-rc3 next-20201112]
[cannot apply to hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Luo-Jiaxing/Introduce-a-new-helper-macro-DEFINE_SHOW_STORE_ATTRIBUTE-at-seq_file-c/20201112-150927
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: x86_64-randconfig-a002-20201111 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project a7b65741441556d295079fc4f2391d99fd1c1111)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/c5417f366b929124a8b8a6add9b86653da6935a8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Luo-Jiaxing/Introduce-a-new-helper-macro-DEFINE_SHOW_STORE_ATTRIBUTE-at-seq_file-c/20201112-150927
git checkout c5417f366b929124a8b8a6add9b86653da6935a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/display/intel_display_debugfs.c:1788:1: error: redefinition of 'i915_hpd_short_storm_ctl_open'
DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);
^
include/linux/seq_file.h:195:12: note: expanded from macro 'DEFINE_SHOW_STORE_ATTRIBUTE'
static int __name ## _open(struct inode *inode, struct file *file) \
^
<scratch space>:154:1: note: expanded from here
i915_hpd_short_storm_ctl_open
^
drivers/gpu/drm/i915/display/intel_display_debugfs.c:1735:1: note: previous definition is here
i915_hpd_short_storm_ctl_open(struct inode *inode, struct file *file)
^
1 error generated.

vim +/i915_hpd_short_storm_ctl_open +1788 drivers/gpu/drm/i915/display/intel_display_debugfs.c

1787
> 1788 DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);
1789

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (2.68 kB)
.config.gz (33.55 kB)
Download all attachments

2020-11-14 05:23:11

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH v4 5/5] drm/i915/display: Introduce DEFINE_SHOW_STORE_ATTRIBUTE for debugfs

Hi Luo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next linus/master v5.10-rc3 next-20201113]
[cannot apply to hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Luo-Jiaxing/Introduce-a-new-helper-macro-DEFINE_SHOW_STORE_ATTRIBUTE-at-seq_file-c/20201112-150927
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/c5417f366b929124a8b8a6add9b86653da6935a8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Luo-Jiaxing/Introduce-a-new-helper-macro-DEFINE_SHOW_STORE_ATTRIBUTE-at-seq_file-c/20201112-150927
git checkout c5417f366b929124a8b8a6add9b86653da6935a8
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from include/drm/drm_debugfs.h:36,
from drivers/gpu/drm/i915/display/intel_display_debugfs.c:6:
>> drivers/gpu/drm/i915/display/intel_display_debugfs.c:1788:29: error: redefinition of 'i915_hpd_short_storm_ctl_open'
1788 | DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:195:12: note: in definition of macro 'DEFINE_SHOW_STORE_ATTRIBUTE'
195 | static int __name ## _open(struct inode *inode, struct file *file) \
| ^~~~~~
drivers/gpu/drm/i915/display/intel_display_debugfs.c:1735:1: note: previous definition of 'i915_hpd_short_storm_ctl_open' was here
1735 | i915_hpd_short_storm_ctl_open(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_display_debugfs.c:1735:1: warning: 'i915_hpd_short_storm_ctl_open' defined but not used [-Wunused-function]

vim +/i915_hpd_short_storm_ctl_open +1788 drivers/gpu/drm/i915/display/intel_display_debugfs.c

1787
> 1788 DEFINE_SHOW_STORE_ATTRIBUTE(i915_hpd_short_storm_ctl);
1789

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (2.62 kB)
.config.gz (44.83 kB)
Download all attachments