* [PATCH] btrfs: fix static checker warnings
@ 2013-11-20 21:50 Jeff Mahoney
2013-11-20 22:16 ` Kees Cook
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Mahoney @ 2013-11-20 21:50 UTC (permalink / raw)
To: linux-btrfs, Josef Bacik; +Cc: Kees Cook, Fengguang Wu
This patch fixes the following warnings:
fs/btrfs/extent-tree.c:6201:12: sparse: symbol 'get_raid_name' was not declared. Should it be static?
fs/btrfs/extent-tree.c:8430:9: error: format not a string literal and no format arguments [-Werror=format-security] get_raid_name(index));
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
fs/btrfs/extent-tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/btrfs/extent-tree.c 2013-11-20 12:21:23.969683074 -0500
+++ b/fs/btrfs/extent-tree.c 2013-11-20 14:43:34.494306159 -0500
@@ -6119,7 +6119,7 @@ static const char *btrfs_raid_type_names
[BTRFS_RAID_RAID6] = "raid6",
};
-const char *get_raid_name(enum btrfs_raid_types type)
+static const char *get_raid_name(enum btrfs_raid_types type)
{
if (type >= BTRFS_NR_RAID_TYPES)
return NULL;
@@ -8328,7 +8328,7 @@ static void __link_block_group(struct bt
kobject_get(&space_info->kobj); /* put in release */
ret = kobject_init_and_add(kobj, &btrfs_raid_ktype,
- &space_info->kobj,
+ &space_info->kobj, "%s",
get_raid_name(index));
if (ret) {
pr_warn("btrfs: failed to add kobject for block cache. ignoring.\n");
--
Jeff Mahoney
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] btrfs: fix static checker warnings
2013-11-20 21:50 [PATCH] btrfs: fix static checker warnings Jeff Mahoney
@ 2013-11-20 22:16 ` Kees Cook
0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2013-11-20 22:16 UTC (permalink / raw)
To: Jeff Mahoney; +Cc: linux-btrfs, Josef Bacik, Fengguang Wu
On Wed, Nov 20, 2013 at 1:50 PM, Jeff Mahoney <jeffm@suse.com> wrote:
> This patch fixes the following warnings:
> fs/btrfs/extent-tree.c:6201:12: sparse: symbol 'get_raid_name' was not declared. Should it be static?
> fs/btrfs/extent-tree.c:8430:9: error: format not a string literal and no format arguments [-Werror=format-security] get_raid_name(index));
>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Thanks!
-Kees
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-20 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 21:50 [PATCH] btrfs: fix static checker warnings Jeff Mahoney
2013-11-20 22:16 ` Kees Cook
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.