Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1205865
| From | Luis Henriques <luis.henriques@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.16.y-ckt 001/118] netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings |
| Date | 2015-08-12 11:50 +0200 |
| Message-ID | <pWAPz-Bo-57@gated-at.bofh.it> (permalink) |
| References | <pWA37-7Qw-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
3.16.7-ckt16 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Gang <gang.chen.5i5j@gmail.com>
commit b18c5d15e8714336365d9d51782d5b53afa0443c upstream.
The related code can be simplified, and also can avoid related warnings
(with allmodconfig under parisc):
CC [M] net/netfilter/nfnetlink_cthelper.o
net/netfilter/nfnetlink_cthelper.c: In function ‘nfnl_cthelper_from_nlattr’:
net/netfilter/nfnetlink_cthelper.c:97:9: warning: passing argument 1 o ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
memcpy(&help->data, nla_data(attr), help->helper->data_len);
^
In file included from include/linux/string.h:17:0,
from include/uapi/linux/uuid.h:25,
from include/linux/uuid.h:23,
from include/linux/mod_devicetable.h:12,
from ./arch/parisc/include/asm/hardware.h:4,
from ./arch/parisc/include/asm/processor.h:15,
from ./arch/parisc/include/asm/spinlock.h:6,
from ./arch/parisc/include/asm/atomic.h:21,
from include/linux/atomic.h:4,
from ./arch/parisc/include/asm/bitops.h:12,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/module.h:9,
from net/netfilter/nfnetlink_cthelper.c:11:
./arch/parisc/include/asm/string.h:8:8: note: expected ‘void *’ but argument is of type ‘const char (*)[]’
void * memcpy(void * dest,const void *src,size_t count);
^
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
net/netfilter/nfnetlink_cthelper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 7f035f0772ee..54330fb5efaf 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -89,7 +89,7 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple,
static int
nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
{
- const struct nf_conn_help *help = nfct_help(ct);
+ struct nf_conn_help *help = nfct_help(ct);
if (attr == NULL)
return -EINVAL;
@@ -97,7 +97,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
if (help->helper->data_len == 0)
return -EINVAL;
- memcpy(&help->data, nla_data(attr), help->helper->data_len);
+ memcpy(help->data, nla_data(attr), help->helper->data_len);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[3.16.y-ckt stable] Linux 3.16.7-ckt16 stable review Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 008/118] ext4: correctly migrate a file with a hole at the beginning Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 007/118] ext4: be more strict when migrating to non-extent based file Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 011/118] drm/radeon: unpin cursor BOs on suspend and pin them again on resume (v2) Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 004/118] Btrfs: fix race between caching kthread and returning inode to inode cache Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 026/118] ARC: Override toplevel default -O2 with -O3 Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 001/118] netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 009/118] ext4: replace open coded nofail allocation in ext4_free_blocks() Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200 [PATCH 3.16.y-ckt 014/118] 9p: don't leave a half-initialized inode sitting around Luis Henriques <luis.henriques@canonical.com> - 2015-08-12 11:50 +0200
csiph-web