Message ID | 20220209095703.517608-5-tzungbi@google.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | platform/chrome: cros_ec: miscellaneous cleanups | expand |
On Feb 09 17:57, Tzung-Bi Shih wrote: > `err` in cros_ec_register() doesn't need to be initialized because it is going > to be overridden in the following code soon. As mentioned in the previous version [1], please drop this patch, since it is not necessary (doesn't meaningfully improve readability, doesn't fix any bugs). [1] https://lore.kernel.org/chrome-platform/CACeCKaeRz2D-DdPRHbrvywTMr2w-MPuGZ+-mBhNtWCapgm=ZXw@mail.gmail.com/ > > Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> > --- > No changes from v2. > > Changes from v1: > (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T/#u) > - Use imperative mood in commit message. > > drivers/platform/chrome/cros_ec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c > index 07dd5cc35d7c..618b8b4c42ef 100644 > --- a/drivers/platform/chrome/cros_ec.c > +++ b/drivers/platform/chrome/cros_ec.c > @@ -182,7 +182,7 @@ static int cros_ec_ready_event(struct notifier_block *nb, > int cros_ec_register(struct cros_ec_device *ec_dev) > { > struct device *dev = ec_dev->dev; > - int err = 0; > + int err; > > BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier); > > -- > 2.35.0.263.gb82422642f-goog >
On Tue, Feb 15, 2022 at 01:39:57PM -0800, Prashant Malani wrote: > On Feb 09 17:57, Tzung-Bi Shih wrote: > > `err` in cros_ec_register() doesn't need to be initialized because it is going > > to be overridden in the following code soon. > > As mentioned in the previous version [1], please drop this patch, since > it is not necessary (doesn't meaningfully improve readability, doesn't > fix any bugs). > > [1] https://lore.kernel.org/chrome-platform/CACeCKaeRz2D-DdPRHbrvywTMr2w-MPuGZ+-mBhNtWCapgm=ZXw@mail.gmail.com/ Ack, will drop it in the next version.
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 07dd5cc35d7c..618b8b4c42ef 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -182,7 +182,7 @@ static int cros_ec_ready_event(struct notifier_block *nb, int cros_ec_register(struct cros_ec_device *ec_dev) { struct device *dev = ec_dev->dev; - int err = 0; + int err; BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier);
`err` in cros_ec_register() doesn't need to be initialized because it is going to be overridden in the following code soon. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> --- No changes from v2. Changes from v1: (https://lore.kernel.org/lkml/20220125101527.1812887-1-tzungbi@google.com/T/#u) - Use imperative mood in commit message. drivers/platform/chrome/cros_ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)