Skip to content

Commit 16c51e4

Browse files
Pintu Kumarsumitsemwal
authored andcommitted
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 <[email protected]> Acked-by: John Stultz <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 689274a commit 16c51e4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/dma-buf/dma-buf.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence)
176176
dmabuf = file->private_data;
177177

178178
/* 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+
*/
181182
if (whence == SEEK_END)
182183
base = dmabuf->size;
183184
else if (whence == SEEK_SET)
@@ -782,13 +783,14 @@ static void mangle_sg_table(struct sg_table *sg_table)
782783
/* To catch abuse of the underlying struct page by importers mix
783784
* up the bits, but take care to preserve the low SG_ bits to
784785
* not corrupt the sgt. The mixing is undone in __unmap_dma_buf
785-
* before passing the sgt back to the exporter. */
786+
* before passing the sgt back to the exporter.
787+
*/
786788
for_each_sgtable_sg(sg_table, sg, i)
787789
sg->page_link ^= ~0xffUL;
788790
#endif
789791

790792
}
791-
static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach,
793+
static struct sg_table *__map_dma_buf(struct dma_buf_attachment *attach,
792794
enum dma_data_direction direction)
793795
{
794796
struct sg_table *sg_table;
@@ -1697,7 +1699,7 @@ static int dma_buf_init_debugfs(void)
16971699

16981700
dma_buf_debugfs_dir = d;
16991701

1700-
d = debugfs_create_file("bufinfo", S_IRUGO, dma_buf_debugfs_dir,
1702+
d = debugfs_create_file("bufinfo", 0444, dma_buf_debugfs_dir,
17011703
NULL, &dma_buf_debug_fops);
17021704
if (IS_ERR(d)) {
17031705
pr_debug("dma_buf: debugfs: failed to create node bufinfo\n");

0 commit comments

Comments
 (0)