Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf: fix S_IRUGO to 0444, block comments, func declaration

These warnings/errors are reported by checkpatch.
Fix them with minor changes to make it clean.
No other functional changes.

WARNING: Block comments use * on subsequent lines
+ /* only support discovering the end of the buffer,
+ but also allow SEEK_SET to maintain the idiomatic

WARNING: Block comments use a trailing */ on a separate line
+ SEEK_END(0), SEEK_CUR(0) pattern */

WARNING: Block comments use a trailing */ on a separate line
+ * before passing the sgt back to the exporter. */

ERROR: "foo * bar" should be "foo *bar"
+static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach,

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+ d = debugfs_create_file("bufinfo", S_IRUGO, dma_buf_debugfs_dir,

total: 1 errors, 4 warnings, 1746 lines checked

Signed-off-by: Pintu Kumar <quic_pintu@quicinc.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241005180955.6523-1-quic_pintu@quicinc.com

authored by

Pintu Kumar and committed by
Sumit Semwal
16c51e42 689274a5

+7 -5
+7 -5
drivers/dma-buf/dma-buf.c
··· 176 176 dmabuf = file->private_data; 177 177 178 178 /* only support discovering the end of the buffer, 179 - but also allow SEEK_SET to maintain the idiomatic 180 - SEEK_END(0), SEEK_CUR(0) pattern */ 179 + * but also allow SEEK_SET to maintain the idiomatic 180 + * SEEK_END(0), SEEK_CUR(0) pattern. 181 + */ 181 182 if (whence == SEEK_END) 182 183 base = dmabuf->size; 183 184 else if (whence == SEEK_SET) ··· 783 782 /* To catch abuse of the underlying struct page by importers mix 784 783 * up the bits, but take care to preserve the low SG_ bits to 785 784 * not corrupt the sgt. The mixing is undone in __unmap_dma_buf 786 - * before passing the sgt back to the exporter. */ 785 + * before passing the sgt back to the exporter. 786 + */ 787 787 for_each_sgtable_sg(sg_table, sg, i) 788 788 sg->page_link ^= ~0xffUL; 789 789 #endif 790 790 791 791 } 792 - static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, 792 + static struct sg_table *__map_dma_buf(struct dma_buf_attachment *attach, 793 793 enum dma_data_direction direction) 794 794 { 795 795 struct sg_table *sg_table; ··· 1699 1697 1700 1698 dma_buf_debugfs_dir = d; 1701 1699 1702 - d = debugfs_create_file("bufinfo", S_IRUGO, dma_buf_debugfs_dir, 1700 + d = debugfs_create_file("bufinfo", 0444, dma_buf_debugfs_dir, 1703 1701 NULL, &dma_buf_debug_fops); 1704 1702 if (IS_ERR(d)) { 1705 1703 pr_debug("dma_buf: debugfs: failed to create node bufinfo\n");