mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Behan Webster <behanw@converseincode.com>
To: andriy.shevchenko@linux.intel.com, aysemelikeyurtoglu@gmail.com,
	matthias.schoepe@studium.uni-erlangen.de, mdcasey@chabloom.com,
	peter.senna@gmail.com, rashika.kheria@gmail.com,
	standby24x7@gmail.com
Cc: behanw@converseincode.com, akpm@linux-foundation.org,
	andreas.frembs@studium.uni-erlangen.de,
	devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, mahati.chamarthy@gmail.com,
	peter.p.waskiewicz.jr@intel.com, quozl@laptop.org,
	valentina.manea.m@gmail.com, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 4/4] staging, rtl8192e, LLVMLinux: Make static local in inline function const
Date: Wed, 29 Oct 2014 15:42:23 -0700	[thread overview]
Message-ID: <1414622543-22969-5-git-send-email-behanw@converseincode.com> (raw)
In-Reply-To: <1414622543-22969-1-git-send-email-behanw@converseincode.com>

rtllib_association_req is a (large) inline function which defines 2 constant
static arrays which aren't labelled as const. As a result clang complains with:

non-constant static local variable in inline function may be different in
different files
[-Wstatic-local-in-inline]
  static u8       AironetIeOui[] = {0x00, 0x01, 0x66};
  ^
The solution is making them "static const".

However doing so requires dropping const when being used with struct
octet_string. However the value is used in a const fashion thereafter, so no
harm done.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/rtl8192e/rtllib_softmac.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 089a058..e970db4 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1311,7 +1311,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,
 	}
 
 	if (beacon->bCkipSupported) {
-		static u8	AironetIeOui[] = {0x00, 0x01, 0x66};
+		static const u8 AironetIeOui[] = {0x00, 0x01, 0x66};
 		u8	CcxAironetBuf[30];
 		struct octet_string osCcxAironetIE;
 
@@ -1331,10 +1331,11 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,
 	}
 
 	if (beacon->bCcxRmEnable) {
-		static u8 CcxRmCapBuf[] = {0x00, 0x40, 0x96, 0x01, 0x01, 0x00};
+		static const u8 CcxRmCapBuf[] = {0x00, 0x40, 0x96, 0x01, 0x01,
+			0x00};
 		struct octet_string osCcxRmCap;
 
-		osCcxRmCap.Octet = CcxRmCapBuf;
+		osCcxRmCap.Octet = (u8 *) CcxRmCapBuf;
 		osCcxRmCap.Length = sizeof(CcxRmCapBuf);
 		tag = skb_put(skb, ccxrm_ie_len);
 		*tag++ = MFIE_TYPE_GENERIC;
-- 
1.9.1


      parent reply	other threads:[~2014-10-29 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 22:42 [PATCH 0/4] staging, rtl8192e, LLVMLinux: Patches to enable the kernel to be compiled with clang/LLVM Behan Webster
2014-10-29 22:42 ` [PATCH 1/4] staging, rtl8192e, LLVMLinux: Change extern inline to static inline Behan Webster
2014-10-29 22:42 ` [PATCH 2/4] staging, rtl8192e, LLVMLinux: Remove unused inline prototype Behan Webster
2014-10-29 22:42 ` [PATCH 3/4] staging, rtl8192e, LLVMLinux: Remove unused prototype Behan Webster
2014-10-29 22:42 ` Behan Webster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414622543-22969-5-git-send-email-behanw@converseincode.com \
    --to=behanw@converseincode.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.frembs@studium.uni-erlangen.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=aysemelikeyurtoglu@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahati.chamarthy@gmail.com \
    --cc=matthias.schoepe@studium.uni-erlangen.de \
    --cc=mdcasey@chabloom.com \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=peter.senna@gmail.com \
    --cc=quozl@laptop.org \
    --cc=rashika.kheria@gmail.com \
    --cc=standby24x7@gmail.com \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®