DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtl8723bs: core: fix a coding style error
@ 2020-05-15  9:40 heshuai1
  2020-05-15 10:05 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: heshuai1 @ 2020-05-15  9:40 UTC (permalink / raw)
  To: gregkh, vkor, nishkadg.linux; +Cc: devel, linux-kernel, heshuai1

Fix this coding style error reported by checkpatch.pl:
  ERROR: do not use assignment in if condition
  #1120: FILE: drivers/staging/rtl8723bs/core/rtw_ieee80211.c:1120::
  +	 if ((addr = of_get_property(np, "local-mac-address", &len)) &&

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index ca98274..06be1d4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1117,8 +1117,8 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
 	}
 
 	if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
-		if ((addr = of_get_property(np, "local-mac-address", &len)) &&
-		    len == ETH_ALEN) {
+		addr = of_get_property(np, "local-mac-address", &len);
+		if (addr && len == ETH_ALEN) {
 			ether_addr_copy(mac_addr, addr);
 		} else {
 			eth_random_addr(mac_addr);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtl8723bs: core: fix a coding style error
  2020-05-15  9:40 [PATCH] rtl8723bs: core: fix a coding style error heshuai1
@ 2020-05-15 10:05 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-05-15 10:05 UTC (permalink / raw)
  To: heshuai1; +Cc: devel, vkor, linux-kernel, nishkadg.linux, heshuai1

On Fri, May 15, 2020 at 05:40:44PM +0800, heshuai1 wrote:
> Fix this coding style error reported by checkpatch.pl:
>   ERROR: do not use assignment in if condition
>   #1120: FILE: drivers/staging/rtl8723bs/core/rtw_ieee80211.c:1120::
>   +	 if ((addr = of_get_property(np, "local-mac-address", &len)) &&
> 
> Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> index ca98274..06be1d4 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> @@ -1117,8 +1117,8 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
>  	}
>  
>  	if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
> -		if ((addr = of_get_property(np, "local-mac-address", &len)) &&
> -		    len == ETH_ALEN) {
> +		addr = of_get_property(np, "local-mac-address", &len);
> +		if (addr && len == ETH_ALEN) {
>  			ether_addr_copy(mac_addr, addr);
>  		} else {
>  			eth_random_addr(mac_addr);
> -- 
> 2.7.4


Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

- It looks like you did not use your "real" name for the patch on either
  the Signed-off-by: line, or the From: line (both of which have to
  match).  Please read the kernel file, Documentation/SubmittingPatches
  for how to do this correctly.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  9:40 [PATCH] rtl8723bs: core: fix a coding style error heshuai1
2020-05-15 10:05 ` Greg KH

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git