* [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro
@ 2024-08-19 9:58 Longlong Xia
2024-09-13 18:39 ` Jeffrey Hugo
2024-09-13 18:41 ` Jeffrey Hugo
0 siblings, 2 replies; 3+ messages in thread
From: Longlong Xia @ 2024-08-19 9:58 UTC (permalink / raw)
To: quic_jhugo; +Cc: quic_carlv, ogabbay, linux-arm-msm, linux-kernel, Longlong Xia
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
No functional change.
Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
---
drivers/accel/qaic/qaic_debugfs.c | 43 ++++---------------------------
1 file changed, 5 insertions(+), 38 deletions(-)
diff --git a/drivers/accel/qaic/qaic_debugfs.c b/drivers/accel/qaic/qaic_debugfs.c
index 20b653d99e52..ba0cf2f94732 100644
--- a/drivers/accel/qaic/qaic_debugfs.c
+++ b/drivers/accel/qaic/qaic_debugfs.c
@@ -64,20 +64,9 @@ static int bootlog_show(struct seq_file *s, void *unused)
return 0;
}
-static int bootlog_fops_open(struct inode *inode, struct file *file)
-{
- return single_open(file, bootlog_show, inode->i_private);
-}
-
-static const struct file_operations bootlog_fops = {
- .owner = THIS_MODULE,
- .open = bootlog_fops_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(bootlog);
-static int read_dbc_fifo_size(struct seq_file *s, void *unused)
+static int fifo_size_show(struct seq_file *s, void *unused)
{
struct dma_bridge_chan *dbc = s->private;
@@ -85,20 +74,9 @@ static int read_dbc_fifo_size(struct seq_file *s, void *unused)
return 0;
}
-static int fifo_size_open(struct inode *inode, struct file *file)
-{
- return single_open(file, read_dbc_fifo_size, inode->i_private);
-}
-
-static const struct file_operations fifo_size_fops = {
- .owner = THIS_MODULE,
- .open = fifo_size_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(fifo_size);
-static int read_dbc_queued(struct seq_file *s, void *unused)
+static int queued_show(struct seq_file *s, void *unused)
{
struct dma_bridge_chan *dbc = s->private;
u32 tail = 0, head = 0;
@@ -115,18 +93,7 @@ static int read_dbc_queued(struct seq_file *s, void *unused)
return 0;
}
-static int queued_open(struct inode *inode, struct file *file)
-{
- return single_open(file, read_dbc_queued, inode->i_private);
-}
-
-static const struct file_operations queued_fops = {
- .owner = THIS_MODULE,
- .open = queued_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(queued);
void qaic_debugfs_init(struct qaic_drm_device *qddev)
{
--
2.45.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro
2024-08-19 9:58 [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro Longlong Xia
@ 2024-09-13 18:39 ` Jeffrey Hugo
2024-09-13 18:41 ` Jeffrey Hugo
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Hugo @ 2024-09-13 18:39 UTC (permalink / raw)
To: Longlong Xia; +Cc: quic_carlv, ogabbay, linux-arm-msm, linux-kernel
On 8/19/2024 3:58 AM, Longlong Xia wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> No functional change.
>
> Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro
2024-08-19 9:58 [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro Longlong Xia
2024-09-13 18:39 ` Jeffrey Hugo
@ 2024-09-13 18:41 ` Jeffrey Hugo
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Hugo @ 2024-09-13 18:41 UTC (permalink / raw)
To: Longlong Xia; +Cc: quic_carlv, ogabbay, linux-arm-msm, linux-kernel
On 8/19/2024 3:58 AM, Longlong Xia wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> No functional change.
>
> Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
Pushed to drm-misc-next
-Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-13 18:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-19 9:58 [PATCH 1/1] accel/qaic: Change to use DEFINE_SHOW_ATTRIBUTE macro Longlong Xia
2024-09-13 18:39 ` Jeffrey Hugo
2024-09-13 18:41 ` Jeffrey Hugo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®