* [PATCH] usb: Assign NULL to phy that may be returned @ 2020-11-06 3:15 Wang Qing 2020-11-06 6:51 ` Greg Kroah-Hartman 0 siblings, 1 reply; 3+ messages in thread From: Wang Qing @ 2020-11-06 3:15 UTC (permalink / raw) To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Wang Qing Assign initial values to local variables that may be returned Signed-off-by: Wang Qing <wangqing@vivo.com> --- drivers/usb/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index b47285f..de21967 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -59,7 +59,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, static struct usb_phy *__of_usb_find_phy(struct device_node *node) { - struct usb_phy *phy; + struct usb_phy *phy = NULL; if (!of_device_is_available(node)) return ERR_PTR(-ENODEV); -- 2.7.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: Assign NULL to phy that may be returned 2020-11-06 3:15 [PATCH] usb: Assign NULL to phy that may be returned Wang Qing @ 2020-11-06 6:51 ` Greg Kroah-Hartman 2020-11-06 7:39 ` 王擎 0 siblings, 1 reply; 3+ messages in thread From: Greg Kroah-Hartman @ 2020-11-06 6:51 UTC (permalink / raw) To: Wang Qing; +Cc: Felipe Balbi, linux-usb, linux-kernel On Fri, Nov 06, 2020 at 11:15:55AM +0800, Wang Qing wrote: > Assign initial values to local variables that may be returned > > Signed-off-by: Wang Qing <wangqing@vivo.com> Your subject, and body of text, seem to have 2 "odd" characters in it, please fix up. Also, your subject and changelog body here are identical, please be much more verbose in the body explaining why you are doing something, not just what you are doing. And your subject line should also match other patches for this file, and have "usb: phy: ..." in the beginning. > --- > drivers/usb/phy/phy.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c > index b47285f..de21967 > --- a/drivers/usb/phy/phy.c > +++ b/drivers/usb/phy/phy.c > @@ -59,7 +59,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, > > static struct usb_phy *__of_usb_find_phy(struct device_node *node) > { > - struct usb_phy *phy; > + struct usb_phy *phy = NULL; Why isn't the compiler complaining about this today? Are you sure this is needed? thanks, greg k-h ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re:Re: [PATCH] usb: Assign NULL to phy that may be returned 2020-11-06 6:51 ` Greg Kroah-Hartman @ 2020-11-06 7:39 ` 王擎 0 siblings, 0 replies; 3+ messages in thread From: 王擎 @ 2020-11-06 7:39 UTC (permalink / raw) To: Greg Kroah-Hartman; +Cc: Felipe Balbi, linux-usb, linux-kernel >> Assign initial values to local variables that may be returned >> >> Signed-off-by: Wang Qing <wangqing@vivo.com> > >Your subject, and body of text, seem to have 2 "odd" characters in it, >please fix up. > >Also, your subject and changelog body here are identical, please be much >more verbose in the body explaining why you are doing something, not >just what you are doing. > >And your subject line should also match other patches for this file, and >have "usb: phy: ..." in the beginning. Yeah, I got it. > >> --- >> drivers/usb/phy/phy.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c >> index b47285f..de21967 >> --- a/drivers/usb/phy/phy.c >> +++ b/drivers/usb/phy/phy.c >> @@ -59,7 +59,7 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, >> >> static struct usb_phy *__of_usb_find_phy(struct device_node *node) >> { >> - struct usb_phy *phy; >> + struct usb_phy *phy = NULL; > >Why isn't the compiler complaining about this today? Are you sure this >is needed? Sorry, I didn't look at it carefully, because __usb_find_phy has an initial value, and I was affected.. You don't need to modify it, In fact. thanks, Wang Qing > >thanks, > >greg k-h ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-06 7:49 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-11-06 3:15 [PATCH] usb: Assign NULL to phy that may be returned Wang Qing 2020-11-06 6:51 ` Greg Kroah-Hartman 2020-11-06 7:39 ` 王擎
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox