* [PATCH] efivars: fix warnings when CONFIG_PSTORE=n
@ 2011-08-02 20:57 Luck, Tony
2011-08-02 21:03 ` Matthew Garrett
2011-08-02 21:05 ` H. Peter Anvin
0 siblings, 2 replies; 4+ messages in thread
From: Luck, Tony @ 2011-08-02 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: Mike Waychison, Matthew Garrett
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]
drivers/firmware/efivars.c:161: warning: ‘utf16_strlen’ defined but not used
utf16_strlen() is only used inside CONFIG_PSTORE - put same #ifdef around the
definition of the function too.
drivers/firmware/efivars.c:602: warning: initialization from incompatible pointer type
Between v1 and v2 of this patch series we decided to make the "part" number
unsigned - but missed fixing the stub version of efi_pstore_write()
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index eacb05e..5315c1e 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -157,11 +157,13 @@ utf16_strnlen(efi_char16_t *s, size_t maxlength)
return length;
}
+#ifdef CONFIG_PSTORE
static unsigned long
utf16_strlen(efi_char16_t *s)
{
return utf16_strnlen(s, ~0UL);
}
+#endif
/*
* Return the number of bytes is the length of this string
@@ -580,8 +582,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
return -1;
}
-static u64 efi_pstore_write(enum pstore_type_id type, int part, size_t size,
- struct pstore_info *psi)
+static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
+ size_t size, struct pstore_info *psi)
{
return 0;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] efivars: fix warnings when CONFIG_PSTORE=n
2011-08-02 20:57 [PATCH] efivars: fix warnings when CONFIG_PSTORE=n Luck, Tony
@ 2011-08-02 21:03 ` Matthew Garrett
2011-08-02 22:01 ` Mike Waychison
2011-08-02 21:05 ` H. Peter Anvin
1 sibling, 1 reply; 4+ messages in thread
From: Matthew Garrett @ 2011-08-02 21:03 UTC (permalink / raw)
To: Luck, Tony; +Cc: linux-kernel, Mike Waychison
On Tue, Aug 02, 2011 at 01:57:06PM -0700, Luck, Tony wrote:
> drivers/firmware/efivars.c:161: warning: ‘utf16_strlen’ defined but not used
> utf16_strlen() is only used inside CONFIG_PSTORE - put same #ifdef around the
> definition of the function too.
>
> drivers/firmware/efivars.c:602: warning: initialization from incompatible pointer type
> Between v1 and v2 of this patch series we decided to make the "part" number
> unsigned - but missed fixing the stub version of efi_pstore_write()
>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efivars: fix warnings when CONFIG_PSTORE=n
2011-08-02 21:03 ` Matthew Garrett
@ 2011-08-02 22:01 ` Mike Waychison
0 siblings, 0 replies; 4+ messages in thread
From: Mike Waychison @ 2011-08-02 22:01 UTC (permalink / raw)
To: Matthew Garrett; +Cc: Luck, Tony, linux-kernel
On Tue, Aug 2, 2011 at 2:03 PM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, Aug 02, 2011 at 01:57:06PM -0700, Luck, Tony wrote:
>> drivers/firmware/efivars.c:161: warning: ‘utf16_strlen’ defined but not used
>> utf16_strlen() is only used inside CONFIG_PSTORE - put same #ifdef around the
>> definition of the function too.
>>
>> drivers/firmware/efivars.c:602: warning: initialization from incompatible pointer type
>> Between v1 and v2 of this patch series we decided to make the "part" number
>> unsigned - but missed fixing the stub version of efi_pstore_write()
>>
>> Signed-off-by: Tony Luck <tony.luck@intel.com>
>
> Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Mike Waychison <mikew@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efivars: fix warnings when CONFIG_PSTORE=n
2011-08-02 20:57 [PATCH] efivars: fix warnings when CONFIG_PSTORE=n Luck, Tony
2011-08-02 21:03 ` Matthew Garrett
@ 2011-08-02 21:05 ` H. Peter Anvin
1 sibling, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2011-08-02 21:05 UTC (permalink / raw)
To: Luck, Tony; +Cc: linux-kernel, Mike Waychison, Matthew Garrett
On 08/02/2011 01:57 PM, Luck, Tony wrote:
>
> +#ifdef CONFIG_PSTORE
> static unsigned long
> utf16_strlen(efi_char16_t *s)
> {
> return utf16_strnlen(s, ~0UL);
> }
> +#endif
>
Unless this is actually called via an indirect function pointer, it can
just be changed to "static inline", which shuts up the warning, too.
-hpa
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-02 22:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02 20:57 [PATCH] efivars: fix warnings when CONFIG_PSTORE=n Luck, Tony
2011-08-02 21:03 ` Matthew Garrett
2011-08-02 22:01 ` Mike Waychison
2011-08-02 21:05 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox