linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: phy: twl4030-usb: Silence checkpatch warnings
@ 2014-02-03  8:25 Sachin Kamat
  2014-02-03  8:25 ` [PATCH 2/3] usb: phy: twl4030-usb: Remove redundant semicolon Sachin Kamat
  2014-02-03  8:25 ` [PATCH 3/3] usb: phy: bcm-kona-usb2: Use PTR_ERR_OR_ZERO Sachin Kamat
  0 siblings, 2 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-02-03  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: kishon, sachin.kamat, patches

Silences the following warnings:
WARNING: sizeof *twl should be sizeof(*twl)
WARNING: sizeof *otg should be sizeof(*otg)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/phy/phy-twl4030-usb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index daf65e68aaab..254c72c94370 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -661,7 +661,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	struct phy_provider	*phy_provider;
 	struct phy_init_data	*init_data = NULL;
 
-	twl = devm_kzalloc(&pdev->dev, sizeof *twl, GFP_KERNEL);
+	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
 	if (!twl)
 		return -ENOMEM;
 
@@ -676,7 +676,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	otg = devm_kzalloc(&pdev->dev, sizeof *otg, GFP_KERNEL);
+	otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
 	if (!otg)
 		return -ENOMEM;
 
-- 
1.7.9.5


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

* [PATCH 2/3] usb: phy: twl4030-usb: Remove redundant semicolon
  2014-02-03  8:25 [PATCH 1/3] usb: phy: twl4030-usb: Silence checkpatch warnings Sachin Kamat
@ 2014-02-03  8:25 ` Sachin Kamat
  2014-02-03  8:25 ` [PATCH 3/3] usb: phy: bcm-kona-usb2: Use PTR_ERR_OR_ZERO Sachin Kamat
  1 sibling, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-02-03  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: kishon, sachin.kamat, patches

Semicolon after switch statement is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/phy/phy-twl4030-usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 254c72c94370..ab64182bafde 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -338,7 +338,7 @@ static void twl4030_usb_set_mode(struct twl4030_usb *twl, int mode)
 		dev_err(twl->dev, "unsupported T2 transceiver mode %d\n",
 				mode);
 		break;
-	};
+	}
 }
 
 static void twl4030_i2c_access(struct twl4030_usb *twl, int on)
-- 
1.7.9.5


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

* [PATCH 3/3] usb: phy: bcm-kona-usb2: Use PTR_ERR_OR_ZERO
  2014-02-03  8:25 [PATCH 1/3] usb: phy: twl4030-usb: Silence checkpatch warnings Sachin Kamat
  2014-02-03  8:25 ` [PATCH 2/3] usb: phy: twl4030-usb: Remove redundant semicolon Sachin Kamat
@ 2014-02-03  8:25 ` Sachin Kamat
  1 sibling, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-02-03  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: kishon, sachin.kamat, patches, Matt Porter

PTR_ERR_OR_ZERO simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Matt Porter <mporter@linaro.org>
---
 drivers/phy/phy-bcm-kona-usb2.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/phy/phy-bcm-kona-usb2.c b/drivers/phy/phy-bcm-kona-usb2.c
index efc5c1a13a5d..e94f5a6a5645 100644
--- a/drivers/phy/phy-bcm-kona-usb2.c
+++ b/drivers/phy/phy-bcm-kona-usb2.c
@@ -128,10 +128,8 @@ static int bcm_kona_usb2_probe(struct platform_device *pdev)
 
 	phy_provider = devm_of_phy_provider_register(dev,
 			of_phy_simple_xlate);
-	if (IS_ERR(phy_provider))
-		return PTR_ERR(phy_provider);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
 static const struct of_device_id bcm_kona_usb2_dt_ids[] = {
-- 
1.7.9.5


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

end of thread, other threads:[~2014-02-03  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-03  8:25 [PATCH 1/3] usb: phy: twl4030-usb: Silence checkpatch warnings Sachin Kamat
2014-02-03  8:25 ` [PATCH 2/3] usb: phy: twl4030-usb: Remove redundant semicolon Sachin Kamat
2014-02-03  8:25 ` [PATCH 3/3] usb: phy: bcm-kona-usb2: Use PTR_ERR_OR_ZERO Sachin Kamat

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