From: Kalle Valo <kvalo@codeaurora.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>,
Colin King <colin.king@canonical.com>,
Johannes Berg <johannes.berg@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Luca Coelho <luciano.coelho@intel.com>,
Intel Linux Wireless <linuxwifi@intel.com>,
"David S . Miller" <davem@davemloft.net>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iwlwifi: pcie: make array prop static, shrinks object size
Date: Thu, 14 Jun 2018 17:36:23 +0300 [thread overview]
Message-ID: <878t7h8mfs.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20180611204506.GA21542@kroah.com> (Greg Kroah-Hartman's message of "Mon, 11 Jun 2018 22:45:06 +0200")
Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> On Mon, Jun 11, 2018 at 12:40:55PM -0700, Joe Perches wrote:
>> (adding Greg KH)
>>
>> Now what is happening is that prop is being reloaded
>> each invocation with the constant addresses of the strings.
>>
>> It seems the prototype and function for kobject_uevent_env
>> should change as well to avoid this.
>>
>> Perhaps this should become:
>> ---
>> drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +-
>> include/linux/kobject.h | 2 +-
>> lib/kobject_uevent.c | 2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
>> index 7229991ae70d..6668a8aad22e 100644
>> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
>> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
>> @@ -1946,7 +1946,7 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk)
>> struct iwl_trans_pcie_removal *removal =
>> container_of(wk, struct iwl_trans_pcie_removal, work);
>> struct pci_dev *pdev = removal->pdev;
>> - char *prop[] = {"EVENT=INACCESSIBLE", NULL};
>> + static const char * const prop[] = {"EVENT=INACCESSIBLE", NULL};
>>
>> dev_err(&pdev->dev, "Device gone - attempting removal\n");
>> kobject_uevent_env(&pdev->dev.kobj, KOBJ_CHANGE, prop);
>> diff --git a/include/linux/kobject.h b/include/linux/kobject.h
>> index 7f6f93c3df9c..9f5cf553dd1e 100644
>> --- a/include/linux/kobject.h
>> +++ b/include/linux/kobject.h
>> @@ -217,7 +217,7 @@ extern struct kobject *firmware_kobj;
>>
>> int kobject_uevent(struct kobject *kobj, enum kobject_action action);
>> int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
>> - char *envp[]);
>> + const char * const envp[]);
>> int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count);
>>
>> __printf(2, 3)
>> diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
>> index 63d0816ab23b..9107989a0cc8 100644
>> --- a/lib/kobject_uevent.c
>> +++ b/lib/kobject_uevent.c
>> @@ -452,7 +452,7 @@ static void zap_modalias_env(struct kobj_uevent_env *env)
>> * corresponding error when it fails.
>> */
>> int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
>> - char *envp_ext[])
>> + const char * const envp_ext[])
>> {
>> struct kobj_uevent_env *env;
>> const char *action_string = kobject_actions[action];
>
> No objection from me, care to make it a real patch so that I can apply
> it after 4.18-rc1 is out?
For the wireless part:
Acked-by: Kalle Valo <kvalo@codeaurora.org>
--
Kalle Valo
next prev parent reply other threads:[~2018-06-14 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 17:15 [PATCH] iwlwifi: pcie: make array prop static, shrinks object size Colin King
2018-06-11 19:40 ` Joe Perches
2018-06-11 20:45 ` Greg Kroah-Hartman
2018-06-14 14:36 ` Kalle Valo [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-21 10:21 [PATCH] iwlwifi: pcie: make array 'prop' " Colin King
2018-09-04 6:07 ` Luciano Coelho
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=878t7h8mfs.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=emmanuel.grumbach@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=johannes.berg@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwifi@intel.com \
--cc=luciano.coelho@intel.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).