linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
@ 2015-12-12 14:45 Benjamin Young
  2015-12-12 15:00 ` Benjamin Young
  2016-02-08  4:09 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Young @ 2015-12-12 14:45 UTC (permalink / raw)
  Cc: Benjamin Young, Greg Kroah-Hartman, tolga ceylan,
	Ravindran, Madhusudhanan (M.), open list:STAGING SUBSYSTEM,
	open list

Fixed coding style for null comparisons in netlogic driver to be more consistant
with the rest of the kernel coding style

Signed-off-by: Benjamin Young <youngcdev@gmail.com>
---
 drivers/staging/netlogic/xlr_net.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 8ae0175..ac93e63 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -147,7 +147,7 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, int size,
 		addr = addr - MAC_SKB_BACK_PTR_SIZE;
 		skb = (struct sk_buff *) *(unsigned long *)addr;
 		skb->dev = adapter->netdev[port];
-		if (skb->dev == NULL)
+		if (!skb->dev)
 			return;
 		ndev = skb->dev;
 		priv = netdev_priv(ndev);
@@ -878,7 +878,7 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv,
 	priv->mii_bus->write = xlr_mii_write;
 	priv->mii_bus->parent = &pdev->dev;
 	priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
-	if (priv->mii_bus->irq == NULL) {
+	if (!priv->mii_bus->irq) {
 		pr_err("irq alloc failed\n");
 		mdiobus_free(priv->mii_bus);
 		return -ENOMEM;
@@ -1037,7 +1037,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 		priv->nd = (struct xlr_net_data *)pdev->dev.platform_data;
 		res = platform_get_resource(pdev, IORESOURCE_MEM, port);
 
-		if (res == NULL) {
+		if (!res) {
 			pr_err("No memory resource for MAC %d\n",
 					priv->port_id);
 			err = -ENODEV;
@@ -1052,7 +1052,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 		adapter->netdev[port] = ndev;
 
 		res = platform_get_resource(pdev, IORESOURCE_IRQ, port);
-		if (res == NULL) {
+		if (!res) {
 			pr_err("No irq resource for MAC %d\n", priv->port_id);
 			err = -ENODEV;
 			goto err_gmac;
-- 
2.5.0


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

* Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
  2015-12-12 14:45 [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with ! Benjamin Young
@ 2015-12-12 15:00 ` Benjamin Young
  2016-02-08  4:09 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Young @ 2015-12-12 15:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, jchandra, ganesanr
  Cc: tolga.ceylan, open list:STAGING SUBSYSTEM, open list, mravindr

On Sat, Dec 12, 2015 at 06:45:59AM -0800, Benjamin Young wrote:
> Fixed coding style for null comparisons in netlogic driver to be more consistant
> with the rest of the kernel coding style
> 
> Signed-off-by: Benjamin Young <youngcdev@gmail.com>
> ---
>  drivers/staging/netlogic/xlr_net.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
> index 8ae0175..ac93e63 100644
> --- a/drivers/staging/netlogic/xlr_net.c
> +++ b/drivers/staging/netlogic/xlr_net.c
> @@ -147,7 +147,7 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, int size,
>  		addr = addr - MAC_SKB_BACK_PTR_SIZE;
>  		skb = (struct sk_buff *) *(unsigned long *)addr;
>  		skb->dev = adapter->netdev[port];
> -		if (skb->dev == NULL)
> +		if (!skb->dev)
>  			return;
>  		ndev = skb->dev;
>  		priv = netdev_priv(ndev);
> @@ -878,7 +878,7 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv,
>  	priv->mii_bus->write = xlr_mii_write;
>  	priv->mii_bus->parent = &pdev->dev;
>  	priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
> -	if (priv->mii_bus->irq == NULL) {
> +	if (!priv->mii_bus->irq) {
>  		pr_err("irq alloc failed\n");
>  		mdiobus_free(priv->mii_bus);
>  		return -ENOMEM;
> @@ -1037,7 +1037,7 @@ static int xlr_net_probe(struct platform_device *pdev)
>  		priv->nd = (struct xlr_net_data *)pdev->dev.platform_data;
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, port);
>  
> -		if (res == NULL) {
> +		if (!res) {
>  			pr_err("No memory resource for MAC %d\n",
>  					priv->port_id);
>  			err = -ENODEV;
> @@ -1052,7 +1052,7 @@ static int xlr_net_probe(struct platform_device *pdev)
>  		adapter->netdev[port] = ndev;
>  
>  		res = platform_get_resource(pdev, IORESOURCE_IRQ, port);
> -		if (res == NULL) {
> +		if (!res) {
>  			pr_err("No irq resource for MAC %d\n", priv->port_id);
>  			err = -ENODEV;
>  			goto err_gmac;
> -- 
> 2.5.0
> 

Adding broadcom engineers.  (Sorry did not see these adresses in the TODO file origionally)

Thanks,
Benjamin Young

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

* Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
  2015-12-12 14:45 [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with ! Benjamin Young
  2015-12-12 15:00 ` Benjamin Young
@ 2016-02-08  4:09 ` Greg Kroah-Hartman
  2016-02-26  8:21   ` Benjamin Young
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-02-08  4:09 UTC (permalink / raw)
  To: Benjamin Young
  Cc: open list:STAGING SUBSYSTEM, Ravindran, Madhusudhanan (M.),
	open list, tolga ceylan

On Sat, Dec 12, 2015 at 06:45:59AM -0800, Benjamin Young wrote:
> Fixed coding style for null comparisons in netlogic driver to be more consistant
> with the rest of the kernel coding style
> 
> Signed-off-by: Benjamin Young <youngcdev@gmail.com>
> ---
>  drivers/staging/netlogic/xlr_net.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Doesn't apply to my tree at all :(

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

* Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
  2016-02-08  4:09 ` Greg Kroah-Hartman
@ 2016-02-26  8:21   ` Benjamin Young
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Young @ 2016-02-26  8:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: open list:STAGING SUBSYSTEM, Ravindran, Madhusudhanan (M.),
	open list, tolga ceylan

On Sun, Feb 07, 2016 at 08:09:01PM -0800, Greg Kroah-Hartman wrote:
> On Sat, Dec 12, 2015 at 06:45:59AM -0800, Benjamin Young wrote:
> > Fixed coding style for null comparisons in netlogic driver to be more consistant
> > with the rest of the kernel coding style
> > 
> > Signed-off-by: Benjamin Young <youngcdev@gmail.com>
> > ---
> >  drivers/staging/netlogic/xlr_net.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Doesn't apply to my tree at all :(

Sorry about that. 

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

end of thread, other threads:[~2016-02-26  8:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12 14:45 [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with ! Benjamin Young
2015-12-12 15:00 ` Benjamin Young
2016-02-08  4:09 ` Greg Kroah-Hartman
2016-02-26  8:21   ` Benjamin Young

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).