Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723938 > unrolled thread

[PATCH] Staging: atomisp: constify driver_attribute

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-31 09:50 +0200
Last post2017-08-31 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] Staging: atomisp: constify driver_attribute Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-31 09:50 +0200

#1723938 — [PATCH] Staging: atomisp: constify driver_attribute

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-31 09:50 +0200
Subject[PATCH] Staging: atomisp: constify driver_attribute
Message-ID<uksoF-2N0-3@gated-at.bofh.it>
driver_attribute are not supposed to change at runtime.
Functions driver_create_file/driver_remove_file are working with
const driver_attribute. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
index 1ae2358..9f74b2d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c
@@ -162,7 +162,7 @@ static ssize_t iunit_dbgopt_store(struct device_driver *drv, const char *buf,
 	return size;
 }
 
-static struct driver_attribute iunit_drvfs_attrs[] = {
+static const struct driver_attribute iunit_drvfs_attrs[] = {
 	__ATTR(dbglvl, 0644, iunit_dbglvl_show, iunit_dbglvl_store),
 	__ATTR(dbgfun, 0644, iunit_dbgfun_show, iunit_dbgfun_store),
 	__ATTR(dbgopt, 0644, iunit_dbgopt_show, iunit_dbgopt_store),
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web