firmware_classs: change val uevent's type to bool
Subsystems (2)
PATCH 1/1 firmware_classs: change val uevent's type to bool
Some place in firmware_class.c using "int uevent" define, but others use "bool uevent".
This patch replace all int uevent define to bool and fix a place missing uevent check.
--- drivers/base/firmware_class.c | 10 +++++----- include/linux/firmware.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/base/firmware_class.c +5 -5
@@ -463,7 +463,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, f_dev->parent = device; f_dev->class = &firmware_class; -dev_set_uevent_suppress (f_dev, true); +if (uevent) +dev_set_uevent_suppress (f_dev, true);/* Need to pin this module until class device is destroyed */ __module_get (THIS_MODULE );
@@ -593,8 +594,7 @@ int request_firmware(const struct firmware **firmware_p, const char *name, struct device *device) { - int uevent = 1; -return _request_firmware (firmware_p, name, device, uevent, false); + return _request_firmware(firmware_p, name, device, true, false); }/**
@@ -618,7 +618,7 @@ struct firmware_work {struct device *device;void *context;void (*cont)(const struct firmware *fw,void *context); -int uevent; +bool uevent; };static int request_firmware_work_func (void *arg)
@@ -661,7 +661,7 @@ static int request_firmware_work_func(void *arg)**/ int request_firmware_nowait ( -struct module *module,int uevent, +struct module *module,bool uevent,const char *name,struct device *device,gfp_t gfp,void *context,void (*cont)(const struct firmware *fw,void *context)) {
include/linux/firmware.h +2 -2
@@ -39,7 +39,7 @@ struct builtin_fw {int request_firmware (const struct firmware **fw,const char *name,struct device *device);int request_firmware_nowait ( -struct module *module,int uevent, +struct module *module,bool uevent,const char *name,struct device *device,gfp_t gfp,void *context,void (*cont)(const struct firmware *fw,void *context));
@@ -52,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw,return -EINVAL ; }static inline int request_firmware_nowait ( -struct module *module,int uevent, +struct module *module,bool uevent,const char *name,struct device *device,gfp_t gfp,void *context,void (*cont)(const struct firmware *fw,void *context)) {
Signature · 1 line
1.6.3.3
@@ -463,7 +463,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name,
f_dev->parent = device;
f_dev->class = &firmware_class;- dev_set_uevent_suppress(f_dev, true);
+ if (uevent)
+ dev_set_uevent_suppress(f_dev, true);
Everything but this is a no-op basically, but you didn't even describe this change?
johannes
--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
Quoted 10 lines · Johannes
drivers/base/firmware_class.c +2
-1@@ -463,7 +463,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, f_dev->parent = device; f_dev->class = &firmware_class; - dev_set_uevent_suppress(f_dev, true); + if (uevent) + dev_set_uevent_suppress(f_dev, true);Everything but this is a no-op basically, but you didn't even describe this change?
Hmm.. Sorry for that, but I mentioned that by "fix a place missing uevent check".
I added this check because I think it should be paired with following dev_set_uevent_suppress(f_dev, false).
Signature · 2 lines
Regards, --Bob
________________________________________
From: Bob Liu [[email protected]]
Sent: Wednesday, January 26, 2011 11:03
To: Berg, Johannes
Cc: [email protected]; [email protected]; Winkler, Tomas; [email protected]; [email protected]
Subject: Re: [PATCH] firmware_classs: change val uevent's type to bool
Quoted 10 lines · Johannes
drivers/base/firmware_class.c +2
-1@@ -463,7 +463,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, f_dev->parent = device; f_dev->class = &firmware_class; -dev_set_uevent_suppress (f_dev, true); +if (uevent) +dev_set_uevent_suppress (f_dev, true);Everything but this is a no-op basically, but you didn't even describe this change?
Hmm.. Sorry for that, but I mentioned that by "fix a place missing uevent check".
I added this check because I think it should be paired with following dev_set_uevent_suppress(f_dev, false).
I don't think it should -- if you don't want uevents, then they should _always_ be suppressed, right?
johannes
--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
Quoted 9 lines · Bob Liu
Quoted 8 lines · Johannes
drivers/base/firmware_class.c +2
-1@@ -463,7 +463,8 @@ fw_create_instance(struct firmware *firmware, const char *fw_name, f_dev->parent = device; f_dev->class = &firmware_class; - dev_set_uevent_suppress(f_dev, true); + if (uevent) + dev_set_uevent_suppress(f_dev, true);
Quoted 8 lines
Quoted 2 lines
Everything but this is a no-op basically, but you didn't even describe this change?
Hmm.. Sorry for that, but I mentioned that by "fix a place missing uevent check".
I added this check because I think it should be paired with followingdev_set_uevent_suppress(f_dev, false).
That's fine, but please, split that out into a separate patch.
Remember, a patch should only do one thing.
Please resend this as two patches and I will be glad to queue it up.
thanks,
greg k-h