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


Groups > linux.kernel > #1279270 > unrolled thread

[PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree

Started byBrent Taylor <motobud@gmail.com>
First post2015-11-29 06:20 +0100
Last post2015-11-30 10:10 +0100
Articles 6 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree Brent Taylor <motobud@gmail.com> - 2015-11-29 06:20 +0100
    Re: [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1  method and use kvfree kbuild test robot <lkp@intel.com> - 2015-11-29 06:30 +0100
    [PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree Brent Taylor <motobud@gmail.com> - 2015-11-29 07:00 +0100
      Re: [PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree Kalle Valo <kvalo@qca.qualcomm.com> - 2015-11-30 09:50 +0100
    Re: [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree Kalle Valo <kvalo@qca.qualcomm.com> - 2015-11-30 09:50 +0100
      Re: [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree Kalle Valo <kvalo@qca.qualcomm.com> - 2015-11-30 10:10 +0100

#1279270 — [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree

FromBrent Taylor <motobud@gmail.com>
Date2015-11-29 06:20 +0100
Subject[PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree
Message-ID<qA2z0-1ZG-9@gated-at.bofh.it>
Signed-off-by: Brent Taylor <motobud@gmail.com>

ath6kl: Use vmalloc for loading firmware using api1 method and free using kvfree
---
Changes v1 -> v2:
   - simplify memory allocation
   - use kvfree

 drivers/net/wireless/ath/ath6kl/core.c | 2 +-
 drivers/net/wireless/ath/ath6kl/init.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 4ec02ce..052e58b 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -343,7 +343,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
 
 	kfree(ar->fw_board);
 	kfree(ar->fw_otp);
-	vfree(ar->fw);
+	kvfree(ar->fw);
 	kfree(ar->fw_patch);
 	kfree(ar->fw_testscript);
 
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 6e473fa..836afea2 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -673,10 +673,15 @@ static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
 		return ret;
 
 	*fw_len = fw_entry->size;
-	*fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
+	if (&ar->fw == fw)
+		*fw = vmalloc(fw_entry->size);
+	else
+		*fw = kmalloc(fw_entry->size);
 
 	if (*fw == NULL)
 		ret = -ENOMEM;
+	else
+		memcpy(*fw, fw_entry->data, fw_entry->size);
 
 	release_firmware(fw_entry);
 
-- 
2.6.3

--
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/

[toc] | [next] | [standalone]


#1279275 — Re: [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree

Fromkbuild test robot <lkp@intel.com>
Date2015-11-29 06:30 +0100
SubjectRe: [PATCH v2] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree
Message-ID<qA2IF-262-1@gated-at.bofh.it>
In reply to#1279270

[Multipart message — attachments visible in raw view] — view raw

Hi Brent,

[auto build test ERROR on: net-next/master]
[also build test ERROR on: v4.4-rc2 next-20151127]

url:    https://github.com/0day-ci/linux/commits/Brent-Taylor/ath6kl-Use-vmalloc-for-loading-firmware-using-api1-method-and-use-kvfree/20151129-132013
config: x86_64-randconfig-x012-201548 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath6kl/init.c: In function 'ath6kl_get_fw':
>> drivers/net/wireless/ath/ath6kl/init.c:679:9: error: too few arguments to function 'kmalloc'
      *fw = kmalloc(fw_entry->size);
            ^
   In file included from include/linux/textsearch.h:8:0,
                    from include/linux/skbuff.h:30,
                    from include/linux/if_ether.h:23,
                    from include/linux/etherdevice.h:25,
                    from drivers/net/wireless/ath/ath6kl/core.h:21,
                    from drivers/net/wireless/ath/ath6kl/init.c:28:
   include/linux/slab.h:428:30: note: declared here
    static __always_inline void *kmalloc(size_t size, gfp_t flags)
                                 ^

vim +/kmalloc +679 drivers/net/wireless/ath/ath6kl/init.c

   673			return ret;
   674	
   675		*fw_len = fw_entry->size;
   676		if (&ar->fw == fw)
   677			*fw = vmalloc(fw_entry->size);
   678		else
 > 679			*fw = kmalloc(fw_entry->size);
   680	
   681		if (*fw == NULL)
   682			ret = -ENOMEM;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1279276 — [PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree

FromBrent Taylor <motobud@gmail.com>
Date2015-11-29 07:00 +0100
Subject[PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree
Message-ID<qA3bI-2gf-1@gated-at.bofh.it>
In reply to#1279270
Signed-off-by: Brent Taylor <motobud@gmail.com>

ath6kl: Use vmalloc for loading firmware using api1 method and free using kvfree

ath6kl: fix kmalloc build error
---
Changes v2 -> v3:
   - fix kmalloc build error

Changes v1 -> v2:
   - simplify memory allocation
   - use kvfree

 drivers/net/wireless/ath/ath6kl/core.c | 2 +-
 drivers/net/wireless/ath/ath6kl/init.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 4ec02ce..052e58b 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -343,7 +343,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
 
 	kfree(ar->fw_board);
 	kfree(ar->fw_otp);
-	vfree(ar->fw);
+	kvfree(ar->fw);
 	kfree(ar->fw_patch);
 	kfree(ar->fw_testscript);
 
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 6e473fa..19535dc 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -673,10 +673,15 @@ static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
 		return ret;
 
 	*fw_len = fw_entry->size;
-	*fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
+	if (&ar->fw == fw)
+		*fw = vmalloc(fw_entry->size);
+	else
+		*fw = kmalloc(fw_entry->size, GFP_KERNEL);
 
 	if (*fw == NULL)
 		ret = -ENOMEM;
+	else
+		memcpy(*fw, fw_entry->data, fw_entry->size);
 
 	release_firmware(fw_entry);
 
-- 
2.6.3

--
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/

[toc] | [prev] | [next] | [standalone]


#1279694 — Re: [PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree

FromKalle Valo <kvalo@qca.qualcomm.com>
Date2015-11-30 09:50 +0100
SubjectRe: [PATCH v3] ath6kl: Use vmalloc for loading firmware using api1 method and use kvfree
Message-ID<qAsjM-1hf-29@gated-at.bofh.it>
In reply to#1279276
Brent Taylor <motobud@gmail.com> writes:

> Signed-off-by: Brent Taylor <motobud@gmail.com>
>
> ath6kl: Use vmalloc for loading firmware using api1 method and free using kvfree
>
> ath6kl: fix kmalloc build error
> ---
> Changes v2 -> v3:
>    - fix kmalloc build error
>
> Changes v1 -> v2:
>    - simplify memory allocation
>    - use kvfree

The commit log in v3 is even worse.

-- 
Kalle Valo
--
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/

[toc] | [prev] | [next] | [standalone]


#1279685

FromKalle Valo <kvalo@qca.qualcomm.com>
Date2015-11-30 09:50 +0100
Message-ID<qAsjL-1hf-5@gated-at.bofh.it>
In reply to#1279270
Brent Taylor <motobud@gmail.com> writes:

> Signed-off-by: Brent Taylor <motobud@gmail.com>
>
> ath6kl: Use vmalloc for loading firmware using api1 method and free using kvfree
> ---
> Changes v1 -> v2:
>    - simplify memory allocation
>    - use kvfree

Why? The commit log should _always_ answer that. Are you fixing a bug
(what bug exactly?), is this just cleanup or what?

And the commit log is wrongly formatted anyway, the Signed-off-by line
should be the last and there should be no "ath6kl:" string in the commit
log (just in the title). Use 'git log' to find examples.

-- 
Kalle Valo
--
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/

[toc] | [prev] | [next] | [standalone]


#1279707

FromKalle Valo <kvalo@qca.qualcomm.com>
Date2015-11-30 10:10 +0100
Message-ID<qAsD7-1CT-7@gated-at.bofh.it>
In reply to#1279685
Kalle Valo <kvalo@qca.qualcomm.com> writes:

> Brent Taylor <motobud@gmail.com> writes:
>
>> Signed-off-by: Brent Taylor <motobud@gmail.com>
>>
>> ath6kl: Use vmalloc for loading firmware using api1 method and free using kvfree
>> ---
>> Changes v1 -> v2:
>>    - simplify memory allocation
>>    - use kvfree
>
> Why? The commit log should _always_ answer that. Are you fixing a bug
> (what bug exactly?), is this just cleanup or what?
>
> And the commit log is wrongly formatted anyway, the Signed-off-by line
> should be the last and there should be no "ath6kl:" string in the commit
> log (just in the title). Use 'git log' to find examples.

Fixing netdev address (kenrel -> kernel)

-- 
Kalle Valo
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web