[PATCH] staging: comedi: remove warnings of comedi_lrange
From: Song Chen
Date: Wed Dec 23 2020 - 20:01:17 EST
Checkpatch.pl reports "warning: struct comedi_lrange should
normally be const" in some places, which are supposed to
be removed.
Signed-off-by: Song Chen <chensong_2000@xxxxxx>
---
drivers/staging/comedi/drivers/das16.c | 4 ++--
drivers/staging/comedi/drivers/jr3_pci.c | 4 ++--
drivers/staging/comedi/drivers/ni_670x.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c
index 4ac2622..40bfd84 100644
--- a/drivers/staging/comedi/drivers/das16.c
+++ b/drivers/staging/comedi/drivers/das16.c
@@ -958,7 +958,7 @@ static const struct comedi_lrange *das16_ai_range(struct comedi_device *dev,
/* get any user-defined input range */
if (pg_type == das16_pg_none && (min || max)) {
- struct comedi_lrange *lrange;
+ const struct comedi_lrange *lrange;
struct comedi_krange *krange;
/* allocate single-range range table */
@@ -992,7 +992,7 @@ static const struct comedi_lrange *das16_ao_range(struct comedi_device *dev,
/* get any user-defined output range */
if (min || max) {
- struct comedi_lrange *lrange;
+ const struct comedi_lrange *lrange;
struct comedi_krange *krange;
/* allocate single-range range table */
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index 7a02c4f..c35db0b 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -91,8 +91,8 @@ struct jr3_pci_dev_private {
};
union jr3_pci_single_range {
- struct comedi_lrange l;
- char _reserved[offsetof(struct comedi_lrange, range[1])];
+ const struct comedi_lrange l;
+ char _reserved[offsetof(const struct comedi_lrange, range[1])];
};
enum jr3_pci_poll_state {
diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c
index c197e47..66485ec 100644
--- a/drivers/staging/comedi/drivers/ni_670x.c
+++ b/drivers/staging/comedi/drivers/ni_670x.c
@@ -200,7 +200,7 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
const struct comedi_lrange **range_table_list;
range_table_list = kmalloc_array(32,
- sizeof(struct comedi_lrange *),
+ sizeof(const struct comedi_lrange *),
GFP_KERNEL);
if (!range_table_list)
return -ENOMEM;
--
2.7.4