This set of patches, basically shuts-up
the warning messages by gcc-4.6.0.
As of now I just went through some
of the trivial ones that might be dead
code reported by gcc(but could be wrong).
Please have a look, if somebody has a better
way of dealing with this, let me know, and
I can test some patches..
Justin P. Mattock
Not sure if this is correct or not, but with
make menuconfig
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function 'conf_sym':
scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
scripts/kconfig/conf.c: In function 'conf_choice':
scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
HOSTLD scripts/kconfig/mconf
I get this using gcc 4.6.0 the below change fixes this form me.
please have a look and let me know.
Signed-off-by: Justin P. Mattock <[email protected]>
---
scripts/kconfig/conf.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9960d1c..d6369e8 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -156,14 +156,12 @@ static int conf_string(struct menu *menu)
static int conf_sym(struct menu *menu)
{
struct symbol *sym = menu->sym;
- int type;
tristate oldval, newval;
while (1) {
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
if (sym->name)
printf("(%s) ", sym->name);
- type = sym_get_type(sym);
putchar('[');
oldval = sym_get_tristate_value(sym);
switch (oldval) {
@@ -228,11 +226,9 @@ static int conf_choice(struct menu *menu)
{
struct symbol *sym, *def_sym;
struct menu *child;
- int type;
bool is_new;
sym = menu->sym;
- type = sym_get_type(sym);
is_new = !sym_has_value(sym);
if (sym_is_changable(sym)) {
conf_sym(menu);
--
1.7.1.rc1.21.gf3bd6
Removing dead code(hopefully), fixes a warning
when compiling the kernel.
CC kernel/audit.o
kernel/audit.c: In function 'audit_buffer_alloc':
kernel/audit.c:1044:19: warning: variable 'nlh' set but not used
CC kernel/auditfilter.o
Signed-off-by: Justin P. Mattock <[email protected]>
---
kernel/audit.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index c71bd26..783d958 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1041,8 +1041,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
{
unsigned long flags;
struct audit_buffer *ab = NULL;
- struct nlmsghdr *nlh;
-
+
spin_lock_irqsave(&audit_freelist_lock, flags);
if (!list_empty(&audit_freelist)) {
ab = list_entry(audit_freelist.next,
@@ -1065,8 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
if (!ab->skb)
goto nlmsg_failure;
- nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
-
+
return ab;
nlmsg_failure: /* Used by NLMSG_NEW */
--
1.7.1.rc1.21.gf3bd6
Im getting these warnings when compiling
(the patch below gets rid of the warning).
CC [M] fs/hfsplus/extents.o
fs/hfsplus/extents.c: In function 'hfsplus_get_block':
fs/hfsplus/extents.c:178:6: warning: variable 'shift' set but not used
CC [M] fs/hfs/bnode.o
fs/hfs/bnode.c: In function 'hfs_bnode_copy':
fs/hfs/bnode.c:100:20: warning: variable 'tree' set but not used
fs/hfs/bnode.c: In function '__hfs_bnode_create':
fs/hfs/bnode.c:238:22: warning: variable 'sb' set but not used
Signed-off-by: Justin P. Mattock <[email protected]>
---
fs/hfs/bnode.c | 4 ----
fs/hfsplus/extents.c | 4 +---
2 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index cdb41a1..c6e0bd2 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -97,13 +97,11 @@ void hfs_bnode_clear(struct hfs_bnode *node, int off, int len)
void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst,
struct hfs_bnode *src_node, int src, int len)
{
- struct hfs_btree *tree;
struct page *src_page, *dst_page;
dprint(DBG_BNODE_MOD, "copybytes: %u,%u,%u\n", dst, src, len);
if (!len)
return;
- tree = src_node->tree;
src += src_node->page_offset;
dst += dst_node->page_offset;
src_page = src_node->page[0];
@@ -235,7 +233,6 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid)
static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
{
- struct super_block *sb;
struct hfs_bnode *node, *node2;
struct address_space *mapping;
struct page *page;
@@ -247,7 +244,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
return NULL;
}
- sb = tree->inode->i_sb;
size = sizeof(struct hfs_bnode) + tree->pages_per_bnode *
sizeof(struct page *);
node = kzalloc(size, GFP_KERNEL);
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index 0022eec..7b5728d 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -175,12 +175,10 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
struct super_block *sb;
int res = -EIO;
u32 ablock, dblock, mask;
- int shift;
-
+
sb = inode->i_sb;
/* Convert inode block to disk allocation block */
- shift = HFSPLUS_SB(sb).alloc_blksz_shift - sb->s_blocksize_bits;
ablock = iblock >> HFSPLUS_SB(sb).fs_shift;
if (iblock >= HFSPLUS_I(inode).fs_blocks) {
--
1.7.1.rc1.21.gf3bd6
The below patch fixes a warning message
reported by gcc 4.6.0.
CC kernel/module.o
kernel/module.c: In function 'add_usage_links':
kernel/module.c:1343:6: warning: variable 'nowarn' set but not used
Signed-off-by: Justin P. Mattock <[email protected]>
---
kernel/module.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 8c6b428..a71027a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1340,13 +1340,9 @@ static void add_usage_links(struct module *mod)
{
#ifdef CONFIG_MODULE_UNLOAD
struct module_use *use;
- int nowarn;
-
+
mutex_lock(&module_mutex);
- list_for_each_entry(use, &mod->target_list, target_list) {
- nowarn = sysfs_create_link(use->target->holders_dir,
- &mod->mkobj.kobj, mod->name);
- }
+ list_for_each_entry(use, &mod->target_list, target_list);
mutex_unlock(&module_mutex);
#endif
}
--
1.7.1.rc1.21.gf3bd6
This fixes this warning message I'm getting:
CC [M] fs/afs/fsclient.o
fs/afs/fsclient.c: In function 'afs_deliver_fs_xxxx_lock':
fs/afs/fsclient.c:1759:16: warning: variable 'bp' set but not used
CC [M] fs/afs/inode.o
Signed-off-by: Justin P. Mattock <[email protected]>
---
fs/afs/fsclient.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 4bd0218..aca2ccb 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -1756,8 +1756,7 @@ int afs_fs_get_volume_status(struct afs_server *server,
static int afs_deliver_fs_xxxx_lock(struct afs_call *call,
struct sk_buff *skb, bool last)
{
- const __be32 *bp;
-
+
_enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
afs_transfer_reply(call, skb);
@@ -1767,8 +1766,6 @@ static int afs_deliver_fs_xxxx_lock(struct afs_call *call,
if (call->reply_size != call->reply_max)
return -EBADMSG;
- /* unmarshall the reply once we've received all of it */
- bp = call->buffer;
/* xdr_decode_AFSVolSync(&bp, call->replyX); */
_leave(" = 0 [done]");
--
1.7.1.rc1.21.gf3bd6
The patch below fixes the warning messages from
gcc 4.6.0 and compiling the kernel.
CC [M] fs/cifs/file.o
fs/cifs/file.c: In function 'cifs_partialpagewrite':
fs/cifs/file.c:1315:23: warning: variable 'pTcon' set but not used
CC [M] fs/cifs/dir.o
fs/cifs/dir.c: In function 'cifs_lookup':
fs/cifs/dir.c:641:15: warning: variable 'filp' set but not used
CC [M] fs/cifs/cifssmb.o
fs/cifs/cifssmb.c: In function 'CIFSSMBSetFileSize':
fs/cifs/cifssmb.c:4855:8: warning: variable 'data_offset' set but not used
CC [M] fs/cifs/cifs_debug.o
Signed-off-by: Justin P. Mattock <[email protected]>
---
fs/cifs/cifssmb.c | 4 +---
fs/cifs/dir.c | 4 +---
fs/cifs/file.c | 6 +-----
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index c65c341..ca872c3 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4852,7 +4852,6 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
__u16 fid, __u32 pid_of_opener, bool SetAllocation)
{
struct smb_com_transaction2_sfi_req *pSMB = NULL;
- char *data_offset;
struct file_end_of_file_info *parm_data;
int rc = 0;
__u16 params, param_offset, offset, byte_count, count;
@@ -4876,8 +4875,7 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
offset = param_offset + params;
- data_offset = (char *) (&pSMB->hdr.Protocol) + offset;
-
+
count = sizeof(struct file_end_of_file_info);
pSMB->MaxParameterCount = cpu_to_le16(2);
/* BB find exact max SMB PDU from sess structure BB */
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 391816b..cd409c0 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -638,8 +638,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
struct cifsTconInfo *pTcon;
struct inode *newInode = NULL;
char *full_path = NULL;
- struct file *filp;
-
+
xid = GetXid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
@@ -734,7 +733,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
direntry->d_op = &cifs_dentry_ops;
d_add(direntry, newInode);
if (posix_open)
- filp = lookup_instantiate_filp(nd, direntry, NULL);
/* since paths are not looked up by component - the parent
directories are presumed to be good here */
renew_parental_timestamps(direntry);
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 75541af..bbb66d5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1311,8 +1311,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
char *write_data;
int rc = -EFAULT;
int bytes_written = 0;
- struct cifs_sb_info *cifs_sb;
- struct cifsTconInfo *pTcon;
struct inode *inode;
struct cifsFileInfo *open_file;
@@ -1320,9 +1318,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
return -EFAULT;
inode = page->mapping->host;
- cifs_sb = CIFS_SB(inode->i_sb);
- pTcon = cifs_sb->tcon;
-
+
offset += (loff_t)from;
write_data = kmap(page);
write_data += from;
--
1.7.1.rc1.21.gf3bd6
On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
<[email protected]> wrote:
> Removing dead code(hopefully), fixes a warning
This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
If you remove the code, it's no longer initialized.
> when compiling the kernel.
>
> CC kernel/audit.o
> kernel/audit.c: In function 'audit_buffer_alloc':
> kernel/audit.c:1044:19: warning: variable 'nlh' set but not used
> CC kernel/auditfilter.o
>
> Signed-off-by: Justin P. Mattock <[email protected]>
>
> ---
> kernel/audit.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index c71bd26..783d958 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -1041,8 +1041,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
> {
> unsigned long flags;
> struct audit_buffer *ab = NULL;
> - struct nlmsghdr *nlh;
> -
> +
> spin_lock_irqsave(&audit_freelist_lock, flags);
> if (!list_empty(&audit_freelist)) {
> ab = list_entry(audit_freelist.next,
> @@ -1065,8 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
> if (!ab->skb)
> goto nlmsg_failure;
>
> - nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
> -
> +
> return ab;
>
> nlmsg_failure: /* Used by NLMSG_NEW */
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
<[email protected]> wrote:
> The below patch fixes a warning message
> reported by gcc 4.6.0.
>
> CC kernel/module.o
> kernel/module.c: In function 'add_usage_links':
> kernel/module.c:1343:6: warning: variable 'nowarn' set but not used
>
> Signed-off-by: Justin P. Mattock <[email protected]>
>
> ---
> kernel/module.c | 8 ++------
> 1 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 8c6b428..a71027a 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1340,13 +1340,9 @@ static void add_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> struct module_use *use;
> - int nowarn;
> -
> +
> mutex_lock(&module_mutex);
> - list_for_each_entry(use, &mod->target_list, target_list) {
> - nowarn = sysfs_create_link(use->target->holders_dir,
> - &mod->mkobj.kobj, mod->name);
> - }
> + list_for_each_entry(use, &mod->target_list, target_list);
> mutex_unlock(&module_mutex);
> #endif
> }
Also wrong, you removed the creation of the links in sysfs.
The assignment to nowarn was there to avoid another compiler warning,
as sysfs_create_link() is marked __must_check.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On 06/11/2010 02:14 PM, Geert Uytterhoeven wrote:
> On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
> <[email protected]> wrote:
>> Removing dead code(hopefully), fixes a warning
>
> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
> If you remove the code, it's no longer initialized.
>
o.k... this one did confuse me a bit, so at the end
I just sent in this one which does remove the function
but does not fix the warning of nlh not being used
>> when compiling the kernel.
>>
>> CC kernel/audit.o
>> kernel/audit.c: In function 'audit_buffer_alloc':
>> kernel/audit.c:1044:19: warning: variable 'nlh' set but not used
>> CC kernel/auditfilter.o
>>
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/audit.c | 6 ++----
>> 1 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/audit.c b/kernel/audit.c
>> index c71bd26..783d958 100644
>> --- a/kernel/audit.c
>> +++ b/kernel/audit.c
>> @@ -1041,8 +1041,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
>> {
>> unsigned long flags;
>> struct audit_buffer *ab = NULL;
>> - struct nlmsghdr *nlh;
>> -
>> +
>> spin_lock_irqsave(&audit_freelist_lock, flags);
>> if (!list_empty(&audit_freelist)) {
>> ab = list_entry(audit_freelist.next,
>> @@ -1065,8 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx,
>> if (!ab->skb)
>> goto nlmsg_failure;
>>
>> - nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
>> -
>> +
>> return ab;
>>
>> nlmsg_failure: /* Used by NLMSG_NEW */
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
if you have any ideas/patches then let me know
I can test it out and see.
Justin P. Mattock
On 06/11/2010 02:17 PM, Geert Uytterhoeven wrote:
> On Fri, Jun 11, 2010 at 22:41, Justin P. Mattock
> <[email protected]> wrote:
>> The below patch fixes a warning message
>> reported by gcc 4.6.0.
>>
>> CC kernel/module.o
>> kernel/module.c: In function 'add_usage_links':
>> kernel/module.c:1343:6: warning: variable 'nowarn' set but not used
>>
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/module.c | 8 ++------
>> 1 files changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8c6b428..a71027a 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1340,13 +1340,9 @@ static void add_usage_links(struct module *mod)
>> {
>> #ifdef CONFIG_MODULE_UNLOAD
>> struct module_use *use;
>> - int nowarn;
>> -
>> +
>> mutex_lock(&module_mutex);
>> - list_for_each_entry(use,&mod->target_list, target_list) {
>> - nowarn = sysfs_create_link(use->target->holders_dir,
>> -&mod->mkobj.kobj, mod->name);
>> - }
>> + list_for_each_entry(use,&mod->target_list, target_list);
>> mutex_unlock(&module_mutex);
>> #endif
>> }
>
> Also wrong, you removed the creation of the links in sysfs.
>
that's not good..
> The assignment to nowarn was there to avoid another compiler warning,
> as sysfs_create_link() is marked __must_check.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
alright.. thanks for having a look
and a response. if somebody has a fix
for this then let me know, and I can
test it out over here(I can also try
fixing this as well, but my knowledge
of code only goes so far)..
Justin P. Mattock
On 11.6.2010 22:41, Justin P. Mattock wrote:
> Not sure if this is correct or not, but with
> make menuconfig
> HOSTCC scripts/kconfig/conf.o
> scripts/kconfig/conf.c: In function 'conf_sym':
> scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
> scripts/kconfig/conf.c: In function 'conf_choice':
> scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
> HOSTLD scripts/kconfig/mconf
>
> I get this using gcc 4.6.0 the below change fixes this form me.
> please have a look and let me know.
>
> Signed-off-by: Justin P. Mattock <[email protected]>
Thanks, applied.
Michal
On 06/11/2010 03:19 PM, Michal Marek wrote:
> On 11.6.2010 22:41, Justin P. Mattock wrote:
>> Not sure if this is correct or not, but with
>> make menuconfig
>> HOSTCC scripts/kconfig/conf.o
>> scripts/kconfig/conf.c: In function 'conf_sym':
>> scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
>> scripts/kconfig/conf.c: In function 'conf_choice':
>> scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
>> HOSTLD scripts/kconfig/mconf
>>
>> I get this using gcc 4.6.0 the below change fixes this form me.
>> please have a look and let me know.
>>
>> Signed-off-by: Justin P. Mattock<[email protected]>
>
> Thanks, applied.
>
> Michal
>
o.k...
Justin P. Mattock
>
> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
> If you remove the code, it's no longer initialized.
I played around with this code some more, but am still getting confused
with nlmsg_new and NLMSG_NEW. if I remove the nlmsghdr struct I can get
a clean build without a warning, but still am a bit confused.
here is an updated patch let me know if it still needs work..
or if it's legit I can resend this.
From 7515a08ba921d3beed33fa5c6b1fbe59cf52e069 Mon Sep 17 00:00:00 2001
From: Justin P. Mattock <[email protected]>
Date: Fri, 18 Jun 2010 19:44:30 -0700
Subject: [PATCH 4/4] audit
Signed-off-by: Justin P. Mattock <[email protected]>
---
kernel/audit.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index c71bd26..1d51258 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1041,7 +1041,6 @@ static struct audit_buffer *
audit_buffer_alloc(struct audit_context *ctx,
{
unsigned long flags;
struct audit_buffer *ab = NULL;
- struct nlmsghdr *nlh;
spin_lock_irqsave(&audit_freelist_lock, flags);
if (!list_empty(&audit_freelist)) {
@@ -1065,7 +1064,7 @@ static struct audit_buffer *
audit_buffer_alloc(struct audit_context *ctx,
if (!ab->skb)
goto nlmsg_failure;
- nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
+ NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
return ab;
--
1.7.1.rc1.21.gf3bd6
Justin P. Mattock
> Also wrong, you removed the creation of the links in sysfs.
>
> The assignment to nowarn was there to avoid another compiler warning,
> as sysfs_create_link() is marked __must_check.
I also went back to this one and made the following changes.. let me
know if it's wrong etc..
From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
From: Justin P. Mattock <[email protected]>
Date: Fri, 18 Jun 2010 22:01:07 -0700
Subject: [PATCH 5/5] module.c
Signed-off-by: Justin P. Mattock <[email protected]>
---
kernel/module.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 8c6b428..48fc5c8 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
{
#ifdef CONFIG_MODULE_UNLOAD
struct module_use *use;
- int nowarn;
mutex_lock(&module_mutex);
list_for_each_entry(use, &mod->target_list, target_list) {
- nowarn = sysfs_create_link(use->target->holders_dir,
+ sysfs_create_link(use->target->holders_dir,
&mod->mkobj.kobj, mod->name);
}
mutex_unlock(&module_mutex);
--
1.7.1.rc1.21.gf3bd6
if it looks good, then I can resend it out.
Justin P. Mattock
On Sat, Jun 19, 2010 at 06:45, Justin P. Mattock
<[email protected]> wrote:
>> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
>> If you remove the code, it's no longer initialized.
>
> I played around with this code some more, but am still getting confused with
> nlmsg_new and NLMSG_NEW. if I remove the nlmsghdr struct I can get a clean
nlmsg_new() allocates a new nlmsg.
NLMSG_NEW() initializes a nlmsg inside an already allocated skbuff.
> build without a warning, but still am a bit confused.
>
> here is an updated patch let me know if it still needs work..
> or if it's legit I can resend this.
Looks OK to me, thanks!
> From 7515a08ba921d3beed33fa5c6b1fbe59cf52e069 Mon Sep 17 00:00:00 2001
> From: Justin P. Mattock <[email protected]>
> Date: Fri, 18 Jun 2010 19:44:30 -0700
> Subject: [PATCH 4/4] audit
> Signed-off-by: Justin P. Mattock <[email protected]>
>
> ---
> kernel/audit.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index c71bd26..1d51258 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -1041,7 +1041,6 @@ static struct audit_buffer * audit_buffer_alloc(struct
> audit_context *ctx,
> {
> unsigned long flags;
> struct audit_buffer *ab = NULL;
> - struct nlmsghdr *nlh;
>
> spin_lock_irqsave(&audit_freelist_lock, flags);
> if (!list_empty(&audit_freelist)) {
> @@ -1065,7 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct
> audit_context *ctx,
> if (!ab->skb)
> goto nlmsg_failure;
>
> - nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
> + NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
>
> return ab;
>
> --
> 1.7.1.rc1.21.gf3bd6
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
<[email protected]> wrote:
>> Also wrong, you removed the creation of the links in sysfs.
>>
>> The assignment to nowarn was there to avoid another compiler warning,
>> as sysfs_create_link() is marked __must_check.
>
> I also went back to this one and made the following changes.. let me know if
> it's wrong etc..
>
> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
> From: Justin P. Mattock <[email protected]>
> Date: Fri, 18 Jun 2010 22:01:07 -0700
> Subject: [PATCH 5/5] module.c
> Signed-off-by: Justin P. Mattock <[email protected]>
>
> ---
> kernel/module.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 8c6b428..48fc5c8 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> struct module_use *use;
> - int nowarn;
>
> mutex_lock(&module_mutex);
> list_for_each_entry(use, &mod->target_list, target_list) {
> - nowarn = sysfs_create_link(use->target->holders_dir,
> + sysfs_create_link(use->target->holders_dir,
> &mod->mkobj.kobj, mod->name);
> }
> mutex_unlock(&module_mutex);
> --
> 1.7.1.rc1.21.gf3bd6
>
> if it looks good, then I can resend it out.
Have you compile-tested this?
As sysfs_create_link() is marked __must_check, that will cause another compiler
warning, but only if CONFIG_SYSFS=y.
Perhaps you can just mark the nowarn variable __unused?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On 06/19/2010 01:06 AM, Geert Uytterhoeven wrote:
> On Sat, Jun 19, 2010 at 06:45, Justin P. Mattock
> <[email protected]> wrote:
>>> This is not dead code. NLMSG_NEW() sets up an nlmsg in ab->skb.
>>> If you remove the code, it's no longer initialized.
>>
>> I played around with this code some more, but am still getting confused with
>> nlmsg_new and NLMSG_NEW. if I remove the nlmsghdr struct I can get a clean
>
> nlmsg_new() allocates a new nlmsg.
> NLMSG_NEW() initializes a nlmsg inside an already allocated skbuff.
>
o.k.. now I see what those two are doing a bit better now nlmsg_new
is the start of a netlink messg, and NLMSG_NEW is a new netlink messg
thats already been started.
>> build without a warning, but still am a bit confused.
>>
>> here is an updated patch let me know if it still needs work..
>> or if it's legit I can resend this.
>
> Looks OK to me, thanks!
>
I'll resend it out with the proper subject, and proper intro to it.
>> From 7515a08ba921d3beed33fa5c6b1fbe59cf52e069 Mon Sep 17 00:00:00 2001
>> From: Justin P. Mattock<[email protected]>
>> Date: Fri, 18 Jun 2010 19:44:30 -0700
>> Subject: [PATCH 4/4] audit
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/audit.c | 3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/audit.c b/kernel/audit.c
>> index c71bd26..1d51258 100644
>> --- a/kernel/audit.c
>> +++ b/kernel/audit.c
>> @@ -1041,7 +1041,6 @@ static struct audit_buffer * audit_buffer_alloc(struct
>> audit_context *ctx,
>> {
>> unsigned long flags;
>> struct audit_buffer *ab = NULL;
>> - struct nlmsghdr *nlh;
>>
>> spin_lock_irqsave(&audit_freelist_lock, flags);
>> if (!list_empty(&audit_freelist)) {
>> @@ -1065,7 +1064,7 @@ static struct audit_buffer * audit_buffer_alloc(struct
>> audit_context *ctx,
>> if (!ab->skb)
>> goto nlmsg_failure;
>>
>> - nlh = NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
>> + NLMSG_NEW(ab->skb, 0, 0, type, 0, 0);
>>
>> return ab;
>>
>> --
>> 1.7.1.rc1.21.gf3bd6
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
thanks for taking the time to look at this.
Justin P. Mattock
On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
> <[email protected]> wrote:
>>> Also wrong, you removed the creation of the links in sysfs.
>>>
>>> The assignment to nowarn was there to avoid another compiler warning,
>>> as sysfs_create_link() is marked __must_check.
>>
>> I also went back to this one and made the following changes.. let me know if
>> it's wrong etc..
>>
>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>> From: Justin P. Mattock<[email protected]>
>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>> Subject: [PATCH 5/5] module.c
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/module.c | 3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8c6b428..48fc5c8 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>> {
>> #ifdef CONFIG_MODULE_UNLOAD
>> struct module_use *use;
>> - int nowarn;
>>
>> mutex_lock(&module_mutex);
>> list_for_each_entry(use,&mod->target_list, target_list) {
>> - nowarn = sysfs_create_link(use->target->holders_dir,
>> + sysfs_create_link(use->target->holders_dir,
>> &mod->mkobj.kobj, mod->name);
>> }
>> mutex_unlock(&module_mutex);
>> --
>> 1.7.1.rc1.21.gf3bd6
>>
>> if it looks good, then I can resend it out.
>
> Have you compile-tested this?
> As sysfs_create_link() is marked __must_check, that will cause another compiler
> warning, but only if CONFIG_SYSFS=y.
>
yeah I did compile test this. greping SYSFS I do have that enabled in
the kernel just to make sure I reset the kernel compiled the warning
showed up, thenI applied this patch and the warning was not there.
could be something different then.
> Perhaps you can just mark the nowarn variable __unused?
sure.. I'll give that a try..
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
again Thanks for your time and info.
Justin P. Mattock
On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
> <[email protected]> wrote:
>>> Also wrong, you removed the creation of the links in sysfs.
>>>
>>> The assignment to nowarn was there to avoid another compiler warning,
>>> as sysfs_create_link() is marked __must_check.
>>
>> I also went back to this one and made the following changes.. let me know if
>> it's wrong etc..
>>
>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>> From: Justin P. Mattock<[email protected]>
>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>> Subject: [PATCH 5/5] module.c
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/module.c | 3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8c6b428..48fc5c8 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>> {
>> #ifdef CONFIG_MODULE_UNLOAD
>> struct module_use *use;
>> - int nowarn;
>>
>> mutex_lock(&module_mutex);
>> list_for_each_entry(use,&mod->target_list, target_list) {
>> - nowarn = sysfs_create_link(use->target->holders_dir,
>> + sysfs_create_link(use->target->holders_dir,
>> &mod->mkobj.kobj, mod->name);
>> }
>> mutex_unlock(&module_mutex);
>> --
>> 1.7.1.rc1.21.gf3bd6
>>
>> if it looks good, then I can resend it out.
>
> Have you compile-tested this?
> As sysfs_create_link() is marked __must_check, that will cause another compiler
> warning, but only if CONFIG_SYSFS=y.
>
> Perhaps you can just mark the nowarn variable __unused?
o.k. this builds cleanly without a warning, but is it the right thing
todo? i.g. rather leave the warning message there and file a bug than
just silence the issue. Anyways here is what I have:
From edbeb2b1ee051218f9e5b93fcb8bbdbf1119a6e4 Mon Sep 17 00:00:00 2001
From: Justin P. Mattock <[email protected]>
Date: Sat, 19 Jun 2010 12:07:32 -0700
Subject: [PATCH 5/5] module.c
Signed-off-by: Justin P. Mattock <[email protected]>
---
kernel/module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 8c6b428..765bac5 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1340,7 +1340,7 @@ static void add_usage_links(struct module *mod)
{
#ifdef CONFIG_MODULE_UNLOAD
struct module_use *use;
- int nowarn;
+ int nowarn __attribute__((unused));
mutex_lock(&module_mutex);
list_for_each_entry(use, &mod->target_list, target_list) {
--
1.7.1.rc1.21.gf3bd6
On Sat, Jun 19, 2010 at 21:10, Justin P. Mattock
<[email protected]> wrote:
> On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
>>
>> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
>> <[email protected]> wrote:
>>>>
>>>> Also wrong, you removed the creation of the links in sysfs.
>>>>
>>>> The assignment to nowarn was there to avoid another compiler warning,
>>>> as sysfs_create_link() is marked __must_check.
>>>
>>> I also went back to this one and made the following changes.. let me know
>>> if
>>> it's wrong etc..
>>>
>>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>>> From: Justin P. Mattock<[email protected]>
>>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>>> Subject: [PATCH 5/5] module.c
>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>
>>> ---
>>> kernel/module.c | 3 +--
>>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/kernel/module.c b/kernel/module.c
>>> index 8c6b428..48fc5c8 100644
>>> --- a/kernel/module.c
>>> +++ b/kernel/module.c
>>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>>> {
>>> #ifdef CONFIG_MODULE_UNLOAD
>>> struct module_use *use;
>>> - int nowarn;
>>>
>>> mutex_lock(&module_mutex);
>>> list_for_each_entry(use,&mod->target_list, target_list) {
>>> - nowarn = sysfs_create_link(use->target->holders_dir,
>>> + sysfs_create_link(use->target->holders_dir,
>>> &mod->mkobj.kobj, mod->name);
>>> }
>>> mutex_unlock(&module_mutex);
>>> --
>>> 1.7.1.rc1.21.gf3bd6
>>>
>>> if it looks good, then I can resend it out.
>>
>> Have you compile-tested this?
>> As sysfs_create_link() is marked __must_check, that will cause another
>> compiler
>> warning, but only if CONFIG_SYSFS=y.
>>
>> Perhaps you can just mark the nowarn variable __unused?
>
>
> o.k. this builds cleanly without a warning, but is it the right thing todo?
> i.g. rather leave the warning message there and file a bug than just silence
> the issue. Anyways here is what I have:
>
> From edbeb2b1ee051218f9e5b93fcb8bbdbf1119a6e4 Mon Sep 17 00:00:00 2001
> From: Justin P. Mattock <[email protected]>
> Date: Sat, 19 Jun 2010 12:07:32 -0700
> Subject: [PATCH 5/5] module.c
> Signed-off-by: Justin P. Mattock <[email protected]>
>
> ---
> kernel/module.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 8c6b428..765bac5 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -1340,7 +1340,7 @@ static void add_usage_links(struct module *mod)
> {
> #ifdef CONFIG_MODULE_UNLOAD
> struct module_use *use;
> - int nowarn;
> + int nowarn __attribute__((unused));
The `__attribute__((unused))' should be `__used'.
>
> mutex_lock(&module_mutex);
> list_for_each_entry(use, &mod->target_list, target_list) {
> --
> 1.7.1.rc1.21.gf3bd6
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On 06/19/2010 12:45 PM, Geert Uytterhoeven wrote:
> On Sat, Jun 19, 2010 at 21:10, Justin P. Mattock
> <[email protected]> wrote:
>> On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
>>>
>>> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
>>> <[email protected]> wrote:
>>>>>
>>>>> Also wrong, you removed the creation of the links in sysfs.
>>>>>
>>>>> The assignment to nowarn was there to avoid another compiler warning,
>>>>> as sysfs_create_link() is marked __must_check.
>>>>
>>>> I also went back to this one and made the following changes.. let me know
>>>> if
>>>> it's wrong etc..
>>>>
>>>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>>>> From: Justin P. Mattock<[email protected]>
>>>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>>>> Subject: [PATCH 5/5] module.c
>>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>>
>>>> ---
>>>> kernel/module.c | 3 +--
>>>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/kernel/module.c b/kernel/module.c
>>>> index 8c6b428..48fc5c8 100644
>>>> --- a/kernel/module.c
>>>> +++ b/kernel/module.c
>>>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>>>> {
>>>> #ifdef CONFIG_MODULE_UNLOAD
>>>> struct module_use *use;
>>>> - int nowarn;
>>>>
>>>> mutex_lock(&module_mutex);
>>>> list_for_each_entry(use,&mod->target_list, target_list) {
>>>> - nowarn = sysfs_create_link(use->target->holders_dir,
>>>> + sysfs_create_link(use->target->holders_dir,
>>>> &mod->mkobj.kobj, mod->name);
>>>> }
>>>> mutex_unlock(&module_mutex);
>>>> --
>>>> 1.7.1.rc1.21.gf3bd6
>>>>
>>>> if it looks good, then I can resend it out.
>>>
>>> Have you compile-tested this?
>>> As sysfs_create_link() is marked __must_check, that will cause another
>>> compiler
>>> warning, but only if CONFIG_SYSFS=y.
>>>
>>> Perhaps you can just mark the nowarn variable __unused?
>>
>>
>> o.k. this builds cleanly without a warning, but is it the right thing todo?
>> i.g. rather leave the warning message there and file a bug than just silence
>> the issue. Anyways here is what I have:
>>
>> From edbeb2b1ee051218f9e5b93fcb8bbdbf1119a6e4 Mon Sep 17 00:00:00 2001
>> From: Justin P. Mattock<[email protected]>
>> Date: Sat, 19 Jun 2010 12:07:32 -0700
>> Subject: [PATCH 5/5] module.c
>> Signed-off-by: Justin P. Mattock<[email protected]>
>>
>> ---
>> kernel/module.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8c6b428..765bac5 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -1340,7 +1340,7 @@ static void add_usage_links(struct module *mod)
>> {
>> #ifdef CONFIG_MODULE_UNLOAD
>> struct module_use *use;
>> - int nowarn;
>> + int nowarn __attribute__((unused));
>
> The `__attribute__((unused))' should be `__used'.
>
I'm confused now. how should I write that out?
(google is not giving me vary many examples on this)
>>
>> mutex_lock(&module_mutex);
>> list_for_each_entry(use,&mod->target_list, target_list) {
>> --
>> 1.7.1.rc1.21.gf3bd6
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
Justin P. Mattock
On Sat, Jun 19, 2010 at 22:10, Justin P. Mattock
<[email protected]> wrote:
> On 06/19/2010 12:45 PM, Geert Uytterhoeven wrote:
>>
>> On Sat, Jun 19, 2010 at 21:10, Justin P. Mattock
>> <[email protected]> wrote:
>>>
>>> On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
>>>>
>>>> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
>>>> <[email protected]> wrote:
>>>>>>
>>>>>> Also wrong, you removed the creation of the links in sysfs.
>>>>>>
>>>>>> The assignment to nowarn was there to avoid another compiler warning,
>>>>>> as sysfs_create_link() is marked __must_check.
>>>>>
>>>>> I also went back to this one and made the following changes.. let me
>>>>> know
>>>>> if
>>>>> it's wrong etc..
>>>>>
>>>>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>>>>> From: Justin P. Mattock<[email protected]>
>>>>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>>>>> Subject: [PATCH 5/5] module.c
>>>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>>>
>>>>> ---
>>>>> kernel/module.c | 3 +--
>>>>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/kernel/module.c b/kernel/module.c
>>>>> index 8c6b428..48fc5c8 100644
>>>>> --- a/kernel/module.c
>>>>> +++ b/kernel/module.c
>>>>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>>>>> {
>>>>> #ifdef CONFIG_MODULE_UNLOAD
>>>>> struct module_use *use;
>>>>> - int nowarn;
>>>>>
>>>>> mutex_lock(&module_mutex);
>>>>> list_for_each_entry(use,&mod->target_list, target_list) {
>>>>> - nowarn = sysfs_create_link(use->target->holders_dir,
>>>>> + sysfs_create_link(use->target->holders_dir,
>>>>> &mod->mkobj.kobj, mod->name);
>>>>> }
>>>>> mutex_unlock(&module_mutex);
>>>>> --
>>>>> 1.7.1.rc1.21.gf3bd6
>>>>>
>>>>> if it looks good, then I can resend it out.
>>>>
>>>> Have you compile-tested this?
>>>> As sysfs_create_link() is marked __must_check, that will cause another
>>>> compiler
>>>> warning, but only if CONFIG_SYSFS=y.
>>>>
>>>> Perhaps you can just mark the nowarn variable __unused?
>>>
>>>
>>> o.k. this builds cleanly without a warning, but is it the right thing
>>> todo?
>>> i.g. rather leave the warning message there and file a bug than just
>>> silence
>>> the issue. Anyways here is what I have:
>>>
>>> From edbeb2b1ee051218f9e5b93fcb8bbdbf1119a6e4 Mon Sep 17 00:00:00 2001
>>> From: Justin P. Mattock<[email protected]>
>>> Date: Sat, 19 Jun 2010 12:07:32 -0700
>>> Subject: [PATCH 5/5] module.c
>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>
>>> ---
>>> kernel/module.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/kernel/module.c b/kernel/module.c
>>> index 8c6b428..765bac5 100644
>>> --- a/kernel/module.c
>>> +++ b/kernel/module.c
>>> @@ -1340,7 +1340,7 @@ static void add_usage_links(struct module *mod)
>>> {
>>> #ifdef CONFIG_MODULE_UNLOAD
>>> struct module_use *use;
>>> - int nowarn;
>>> + int nowarn __attribute__((unused));
>>
>> The `__attribute__((unused))' should be `__used'.
>>
>
> I'm confused now. how should I write that out?
> (google is not giving me vary many examples on this)
Sorry, I misrememberd there was a #define for it, and could find only __used.
But on closer look, the `__attribute__((unused)` is correct.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On 06/19/2010 01:23 PM, Geert Uytterhoeven wrote:
> On Sat, Jun 19, 2010 at 22:10, Justin P. Mattock
> <[email protected]> wrote:
>> On 06/19/2010 12:45 PM, Geert Uytterhoeven wrote:
>>>
>>> On Sat, Jun 19, 2010 at 21:10, Justin P. Mattock
>>> <[email protected]> wrote:
>>>>
>>>> On 06/19/2010 01:08 AM, Geert Uytterhoeven wrote:
>>>>>
>>>>> On Sat, Jun 19, 2010 at 07:04, Justin P. Mattock
>>>>> <[email protected]> wrote:
>>>>>>>
>>>>>>> Also wrong, you removed the creation of the links in sysfs.
>>>>>>>
>>>>>>> The assignment to nowarn was there to avoid another compiler warning,
>>>>>>> as sysfs_create_link() is marked __must_check.
>>>>>>
>>>>>> I also went back to this one and made the following changes.. let me
>>>>>> know
>>>>>> if
>>>>>> it's wrong etc..
>>>>>>
>>>>>> From 4f45beed80627d2bb32fb021bb6d22d88089557b Mon Sep 17 00:00:00 2001
>>>>>> From: Justin P. Mattock<[email protected]>
>>>>>> Date: Fri, 18 Jun 2010 22:01:07 -0700
>>>>>> Subject: [PATCH 5/5] module.c
>>>>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>>>>
>>>>>> ---
>>>>>> kernel/module.c | 3 +--
>>>>>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/kernel/module.c b/kernel/module.c
>>>>>> index 8c6b428..48fc5c8 100644
>>>>>> --- a/kernel/module.c
>>>>>> +++ b/kernel/module.c
>>>>>> @@ -1340,11 +1340,10 @@ static void add_usage_links(struct module *mod)
>>>>>> {
>>>>>> #ifdef CONFIG_MODULE_UNLOAD
>>>>>> struct module_use *use;
>>>>>> - int nowarn;
>>>>>>
>>>>>> mutex_lock(&module_mutex);
>>>>>> list_for_each_entry(use,&mod->target_list, target_list) {
>>>>>> - nowarn = sysfs_create_link(use->target->holders_dir,
>>>>>> + sysfs_create_link(use->target->holders_dir,
>>>>>> &mod->mkobj.kobj, mod->name);
>>>>>> }
>>>>>> mutex_unlock(&module_mutex);
>>>>>> --
>>>>>> 1.7.1.rc1.21.gf3bd6
>>>>>>
>>>>>> if it looks good, then I can resend it out.
>>>>>
>>>>> Have you compile-tested this?
>>>>> As sysfs_create_link() is marked __must_check, that will cause another
>>>>> compiler
>>>>> warning, but only if CONFIG_SYSFS=y.
>>>>>
>>>>> Perhaps you can just mark the nowarn variable __unused?
>>>>
>>>>
>>>> o.k. this builds cleanly without a warning, but is it the right thing
>>>> todo?
>>>> i.g. rather leave the warning message there and file a bug than just
>>>> silence
>>>> the issue. Anyways here is what I have:
>>>>
>>>> From edbeb2b1ee051218f9e5b93fcb8bbdbf1119a6e4 Mon Sep 17 00:00:00 2001
>>>> From: Justin P. Mattock<[email protected]>
>>>> Date: Sat, 19 Jun 2010 12:07:32 -0700
>>>> Subject: [PATCH 5/5] module.c
>>>> Signed-off-by: Justin P. Mattock<[email protected]>
>>>>
>>>> ---
>>>> kernel/module.c | 2 +-
>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/kernel/module.c b/kernel/module.c
>>>> index 8c6b428..765bac5 100644
>>>> --- a/kernel/module.c
>>>> +++ b/kernel/module.c
>>>> @@ -1340,7 +1340,7 @@ static void add_usage_links(struct module *mod)
>>>> {
>>>> #ifdef CONFIG_MODULE_UNLOAD
>>>> struct module_use *use;
>>>> - int nowarn;
>>>> + int nowarn __attribute__((unused));
>>>
>>> The `__attribute__((unused))' should be `__used'.
>>>
>>
>> I'm confused now. how should I write that out?
>> (google is not giving me vary many examples on this)
>
> Sorry, I misrememberd there was a #define for it, and could find only __used.
> But on closer look, the `__attribute__((unused)` is correct.
>
alright!! then I'll resend this with the above change.
Thanks for looking at this!!
Justin P. Mattock
> ...
> @@ -734,7 +733,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
> direntry->d_op =&cifs_dentry_ops;
> d_add(direntry, newInode);
> if (posix_open)
> - filp = lookup_instantiate_filp(nd, direntry, NULL);
> /* since paths are not looked up by component - the parent
> directories are presumed to be good here */
> renew_parental_timestamps(direntry);
> ...
This is wrong, now "renew_parental_timestamps(direntry)" is in the if body.
On 06/20/2010 06:22 AM, Alessandro Guido wrote:
>> ...
>> @@ -734,7 +733,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct
>> dentry *direntry,
>> direntry->d_op =&cifs_dentry_ops;
>> d_add(direntry, newInode);
>> if (posix_open)
>> - filp = lookup_instantiate_filp(nd, direntry, NULL);
>> /* since paths are not looked up by component - the parent
>> directories are presumed to be good here */
>> renew_parental_timestamps(direntry);
>> ...
>
> This is wrong, now "renew_parental_timestamps(direntry)" is in the if body.
>
>
>
have you had a chance to look at the later one I had sent in yesterday?
if so out of the two, which might be a better bet(keep in mind the first
set has whitespace issues).
Justin P. Mattock