Re: [PATCH] pcie: portdrv: Fix Unnecessary space before function pointer arguments

2018-12-06 Thread Benjamin Young
Thanks, I will do that next time :)

On Thu, Dec 6, 2018 at 12:44 PM Bjorn Helgaas  wrote:
>
> On Sat, Dec 01, 2018 at 08:07:11AM -0800, Benjamin Young wrote:
> > Made spacing more consistent in the code for function pointer
> > declarations based on checkpatch.pl
> >
> > Signed-off-by: Benjamin Young 
>
> Applied to pci/misc for v4.21, thanks!
>
> I also made similar changes to include/linux/pci.h.  For trivial changes
> like this I like to fix similar issues in all of PCI at the same time.
>
> > ---
> >  drivers/pci/pcie/portdrv.h | 16 
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
> > index e495f04..fbbf00b0 100644
> > --- a/drivers/pci/pcie/portdrv.h
> > +++ b/drivers/pci/pcie/portdrv.h
> > @@ -71,19 +71,19 @@ static inline void *get_service_data(struct pcie_device 
> > *dev)
> >
> >  struct pcie_port_service_driver {
> >   const char *name;
> > - int (*probe) (struct pcie_device *dev);
> > - void (*remove) (struct pcie_device *dev);
> > - int (*suspend) (struct pcie_device *dev);
> > - int (*resume_noirq) (struct pcie_device *dev);
> > - int (*resume) (struct pcie_device *dev);
> > - int (*runtime_suspend) (struct pcie_device *dev);
> > - int (*runtime_resume) (struct pcie_device *dev);
> > + int (*probe)(struct pcie_device *dev);
> > + void (*remove)(struct pcie_device *dev);
> > + int (*suspend)(struct pcie_device *dev);
> > + int (*resume_noirq)(struct pcie_device *dev);
> > + int (*resume)(struct pcie_device *dev);
> > + int (*runtime_suspend)(struct pcie_device *dev);
> > + int (*runtime_resume)(struct pcie_device *dev);
> >
> >   /* Device driver may resume normal operations */
> >   void (*error_resume)(struct pci_dev *dev);
> >
> >   /* Link Reset Capability - AER service driver specific */
> > - pci_ers_result_t (*reset_link) (struct pci_dev *dev);
> > + pci_ers_result_t (*reset_link)(struct pci_dev *dev);
> >
> >   int port_type;  /* Type of the port this driver can handle */
> >   u32 service;/* Port service this device represents */
> > --
> > 2.5.0
> >


Re: [PATCH] pcie: portdrv: Fix Unnecessary space before function pointer arguments

2018-12-06 Thread Benjamin Young
Thanks, I will do that next time :)

On Thu, Dec 6, 2018 at 12:44 PM Bjorn Helgaas  wrote:
>
> On Sat, Dec 01, 2018 at 08:07:11AM -0800, Benjamin Young wrote:
> > Made spacing more consistent in the code for function pointer
> > declarations based on checkpatch.pl
> >
> > Signed-off-by: Benjamin Young 
>
> Applied to pci/misc for v4.21, thanks!
>
> I also made similar changes to include/linux/pci.h.  For trivial changes
> like this I like to fix similar issues in all of PCI at the same time.
>
> > ---
> >  drivers/pci/pcie/portdrv.h | 16 
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
> > index e495f04..fbbf00b0 100644
> > --- a/drivers/pci/pcie/portdrv.h
> > +++ b/drivers/pci/pcie/portdrv.h
> > @@ -71,19 +71,19 @@ static inline void *get_service_data(struct pcie_device 
> > *dev)
> >
> >  struct pcie_port_service_driver {
> >   const char *name;
> > - int (*probe) (struct pcie_device *dev);
> > - void (*remove) (struct pcie_device *dev);
> > - int (*suspend) (struct pcie_device *dev);
> > - int (*resume_noirq) (struct pcie_device *dev);
> > - int (*resume) (struct pcie_device *dev);
> > - int (*runtime_suspend) (struct pcie_device *dev);
> > - int (*runtime_resume) (struct pcie_device *dev);
> > + int (*probe)(struct pcie_device *dev);
> > + void (*remove)(struct pcie_device *dev);
> > + int (*suspend)(struct pcie_device *dev);
> > + int (*resume_noirq)(struct pcie_device *dev);
> > + int (*resume)(struct pcie_device *dev);
> > + int (*runtime_suspend)(struct pcie_device *dev);
> > + int (*runtime_resume)(struct pcie_device *dev);
> >
> >   /* Device driver may resume normal operations */
> >   void (*error_resume)(struct pci_dev *dev);
> >
> >   /* Link Reset Capability - AER service driver specific */
> > - pci_ers_result_t (*reset_link) (struct pci_dev *dev);
> > + pci_ers_result_t (*reset_link)(struct pci_dev *dev);
> >
> >   int port_type;  /* Type of the port this driver can handle */
> >   u32 service;/* Port service this device represents */
> > --
> > 2.5.0
> >


[PATCH] pcie: portdrv: Fix Unnecessary space before function pointer arguments

2018-12-01 Thread Benjamin Young
Made spacing more consistent in the code for function pointer
declarations based on checkpatch.pl

Signed-off-by: Benjamin Young 
---
 drivers/pci/pcie/portdrv.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index e495f04..fbbf00b0 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -71,19 +71,19 @@ static inline void *get_service_data(struct pcie_device 
*dev)
 
 struct pcie_port_service_driver {
const char *name;
-   int (*probe) (struct pcie_device *dev);
-   void (*remove) (struct pcie_device *dev);
-   int (*suspend) (struct pcie_device *dev);
-   int (*resume_noirq) (struct pcie_device *dev);
-   int (*resume) (struct pcie_device *dev);
-   int (*runtime_suspend) (struct pcie_device *dev);
-   int (*runtime_resume) (struct pcie_device *dev);
+   int (*probe)(struct pcie_device *dev);
+   void (*remove)(struct pcie_device *dev);
+   int (*suspend)(struct pcie_device *dev);
+   int (*resume_noirq)(struct pcie_device *dev);
+   int (*resume)(struct pcie_device *dev);
+   int (*runtime_suspend)(struct pcie_device *dev);
+   int (*runtime_resume)(struct pcie_device *dev);
 
/* Device driver may resume normal operations */
void (*error_resume)(struct pci_dev *dev);
 
/* Link Reset Capability - AER service driver specific */
-   pci_ers_result_t (*reset_link) (struct pci_dev *dev);
+   pci_ers_result_t (*reset_link)(struct pci_dev *dev);
 
int port_type;  /* Type of the port this driver can handle */
u32 service;/* Port service this device represents */
-- 
2.5.0



[PATCH] pcie: portdrv: Fix Unnecessary space before function pointer arguments

2018-12-01 Thread Benjamin Young
Made spacing more consistent in the code for function pointer
declarations based on checkpatch.pl

Signed-off-by: Benjamin Young 
---
 drivers/pci/pcie/portdrv.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index e495f04..fbbf00b0 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -71,19 +71,19 @@ static inline void *get_service_data(struct pcie_device 
*dev)
 
 struct pcie_port_service_driver {
const char *name;
-   int (*probe) (struct pcie_device *dev);
-   void (*remove) (struct pcie_device *dev);
-   int (*suspend) (struct pcie_device *dev);
-   int (*resume_noirq) (struct pcie_device *dev);
-   int (*resume) (struct pcie_device *dev);
-   int (*runtime_suspend) (struct pcie_device *dev);
-   int (*runtime_resume) (struct pcie_device *dev);
+   int (*probe)(struct pcie_device *dev);
+   void (*remove)(struct pcie_device *dev);
+   int (*suspend)(struct pcie_device *dev);
+   int (*resume_noirq)(struct pcie_device *dev);
+   int (*resume)(struct pcie_device *dev);
+   int (*runtime_suspend)(struct pcie_device *dev);
+   int (*runtime_resume)(struct pcie_device *dev);
 
/* Device driver may resume normal operations */
void (*error_resume)(struct pci_dev *dev);
 
/* Link Reset Capability - AER service driver specific */
-   pci_ers_result_t (*reset_link) (struct pci_dev *dev);
+   pci_ers_result_t (*reset_link)(struct pci_dev *dev);
 
int port_type;  /* Type of the port this driver can handle */
u32 service;/* Port service this device represents */
-- 
2.5.0



Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2016-02-26 Thread Benjamin Young
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 <youngc...@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. 


Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2016-02-26 Thread Benjamin Young
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 
> > ---
> >  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. 


[PATCH] drivers: thunderbolt: Coding Style Fix - Put for loop brace on same line

2015-12-17 Thread Benjamin Young
Made code more standard by fixing issue with _for_ loops not putting
braces on the next line.

Signed-off-by: Benjamin Young 
---
 drivers/thunderbolt/tb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index d2c3fe3..7bce491 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -64,8 +64,7 @@ static void tb_free_invalid_tunnels(struct tb *tb)
 {
struct tb_pci_tunnel *tunnel;
struct tb_pci_tunnel *n;
-   list_for_each_entry_safe(tunnel, n, >tunnel_list, list)
-   {
+   list_for_each_entry_safe(tunnel, n, >tunnel_list, list) {
if (tb_pci_is_invalid(tunnel)) {
tb_pci_deactivate(tunnel);
tb_pci_free(tunnel);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: thunderbolt: Coding Style Fix - Put for loop brace on same line

2015-12-17 Thread Benjamin Young
Made code more standard by fixing issue with _for_ loops not putting
braces on the next line.

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/thunderbolt/tb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index d2c3fe3..7bce491 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -64,8 +64,7 @@ static void tb_free_invalid_tunnels(struct tb *tb)
 {
struct tb_pci_tunnel *tunnel;
struct tb_pci_tunnel *n;
-   list_for_each_entry_safe(tunnel, n, >tunnel_list, list)
-   {
+   list_for_each_entry_safe(tunnel, n, >tunnel_list, list) {
if (tb_pci_is_invalid(tunnel)) {
tb_pci_deactivate(tunnel);
tb_pci_free(tunnel);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: thunderbold: Fixed Coding Style - Missing a blank line after declarations

2015-12-16 Thread Benjamin Young
Fixed coding style issue for missing blank lines after variable
  declarations.

Signed-off-by: Benjamin Young 
---
 drivers/thunderbolt/cap.c|  2 ++
 drivers/thunderbolt/ctl.c| 10 ++
 drivers/thunderbolt/eeprom.c | 11 +++
 drivers/thunderbolt/nhi.c| 13 +
 drivers/thunderbolt/path.c   |  5 +
 drivers/thunderbolt/switch.c |  8 
 drivers/thunderbolt/tb.c | 10 ++
 drivers/thunderbolt/tunnel_pci.c |  4 
 8 files changed, 63 insertions(+)

diff --git a/drivers/thunderbolt/cap.c b/drivers/thunderbolt/cap.c
index a7b47e7..31be7bc 100644
--- a/drivers/thunderbolt/cap.c
+++ b/drivers/thunderbolt/cap.c
@@ -43,6 +43,7 @@ static enum tb_cap tb_cap(struct tb_cap_any *cap)
 static u32 tb_cap_next(struct tb_cap_any *cap, u32 offset)
 {
int next;
+
if (offset == 1) {
/*
 * The first pointer is part of the switch header and always
@@ -83,6 +84,7 @@ int tb_find_cap(struct tb_port *port, enum tb_cfg_space 
space, enum tb_cap cap)
struct tb_cap_any header;
int res;
int retries = 10;
+
while (retries--) {
res = tb_port_read(port, , space, offset, 1);
if (res) {
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 799634b..0cde9d7 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -202,6 +202,7 @@ static struct tb_cfg_result decode_error(struct ctl_pkg 
*response)
 {
struct cfg_error_pkg *pkg = response->buffer;
struct tb_cfg_result res = { 0 };
+
res.response_route = get_route(pkg->header);
res.response_port = 0;
res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR,
@@ -276,6 +277,7 @@ static void tb_cfg_print_error(struct tb_ctl *ctl,
 static void cpu_to_be32_array(__be32 *dst, u32 *src, size_t len)
 {
int i;
+
for (i = 0; i < len; i++)
dst[i] = cpu_to_be32(src[i]);
 }
@@ -283,6 +285,7 @@ static void cpu_to_be32_array(__be32 *dst, u32 *src, size_t 
len)
 static void be32_to_cpu_array(u32 *dst, __be32 *src, size_t len)
 {
int i;
+
for (i = 0; i < len; i++)
dst[i] = be32_to_cpu(src[i]);
 }
@@ -304,6 +307,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg)
 static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl)
 {
struct ctl_pkg *pkg = kzalloc(sizeof(*pkg), GFP_KERNEL);
+
if (!pkg)
return NULL;
pkg->ctl = ctl;
@@ -323,6 +327,7 @@ static void tb_ctl_tx_callback(struct tb_ring *ring, struct 
ring_frame *frame,
   bool canceled)
 {
struct ctl_pkg *pkg = container_of(frame, typeof(*pkg), frame);
+
tb_ctl_pkg_free(pkg);
 }
 
@@ -338,6 +343,7 @@ static int tb_ctl_tx(struct tb_ctl *ctl, void *data, size_t 
len,
 {
int res;
struct ctl_pkg *pkg;
+
if (len % 4 != 0) { /* required for le->be conversion */
tb_ctl_WARN(ctl, "TX: invalid size: %zu\n", len);
return -EINVAL;
@@ -370,6 +376,7 @@ static void tb_ctl_handle_plug_event(struct tb_ctl *ctl,
 struct ctl_pkg *response)
 {
struct cfg_event_pkg *pkg = response->buffer;
+
u64 route = get_route(pkg->header);
 
if (check_header(response, sizeof(*pkg), TB_CFG_PKG_EVENT, route)) {
@@ -475,6 +482,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, hotplug_cb 
cb, void *cb_data)
 {
int i;
struct tb_ctl *ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
+
if (!ctl)
return NULL;
ctl->nhi = nhi;
@@ -520,6 +528,7 @@ err:
 void tb_ctl_free(struct tb_ctl *ctl)
 {
int i;
+
if (ctl->rx)
ring_free(ctl->rx);
if (ctl->tx)
@@ -541,6 +550,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
 void tb_ctl_start(struct tb_ctl *ctl)
 {
int i;
+
tb_ctl_info(ctl, "control channel starting...\n");
ring_start(ctl->tx); /* is used to ack hotplug packets, start first */
ring_start(ctl->rx);
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 0dde34e..9ff432b 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -39,6 +39,7 @@ static int tb_eeprom_active(struct tb_switch *sw, bool enable)
 {
struct tb_eeprom_ctl ctl;
int res = tb_eeprom_ctl_read(sw, );
+
if (res)
return res;
if (enable) {
@@ -68,6 +69,7 @@ static int tb_eeprom_transfer(struct tb_switch *sw, struct 
tb_eeprom_ctl *ctl,
  enum tb_eeprom_transfer direction)
 {
int res;
+
if (direction == TB_EEPROM_OUT) {
res = tb_eeprom_ctl_write(sw, ctl);
if (res)
@@ -94,6 +96,7 @@ static int tb_eeprom_out(struct tb_switch *sw, u8 val)
struct tb_eeprom_c

[PATCH] drivers: thunderbold: Fixed Coding Style - Missing a blank line after declarations

2015-12-16 Thread Benjamin Young
Fixed coding style issue for missing blank lines after variable
  declarations.

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/thunderbolt/cap.c|  2 ++
 drivers/thunderbolt/ctl.c| 10 ++
 drivers/thunderbolt/eeprom.c | 11 +++
 drivers/thunderbolt/nhi.c| 13 +
 drivers/thunderbolt/path.c   |  5 +
 drivers/thunderbolt/switch.c |  8 
 drivers/thunderbolt/tb.c | 10 ++
 drivers/thunderbolt/tunnel_pci.c |  4 
 8 files changed, 63 insertions(+)

diff --git a/drivers/thunderbolt/cap.c b/drivers/thunderbolt/cap.c
index a7b47e7..31be7bc 100644
--- a/drivers/thunderbolt/cap.c
+++ b/drivers/thunderbolt/cap.c
@@ -43,6 +43,7 @@ static enum tb_cap tb_cap(struct tb_cap_any *cap)
 static u32 tb_cap_next(struct tb_cap_any *cap, u32 offset)
 {
int next;
+
if (offset == 1) {
/*
 * The first pointer is part of the switch header and always
@@ -83,6 +84,7 @@ int tb_find_cap(struct tb_port *port, enum tb_cfg_space 
space, enum tb_cap cap)
struct tb_cap_any header;
int res;
int retries = 10;
+
while (retries--) {
res = tb_port_read(port, , space, offset, 1);
if (res) {
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 799634b..0cde9d7 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -202,6 +202,7 @@ static struct tb_cfg_result decode_error(struct ctl_pkg 
*response)
 {
struct cfg_error_pkg *pkg = response->buffer;
struct tb_cfg_result res = { 0 };
+
res.response_route = get_route(pkg->header);
res.response_port = 0;
res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR,
@@ -276,6 +277,7 @@ static void tb_cfg_print_error(struct tb_ctl *ctl,
 static void cpu_to_be32_array(__be32 *dst, u32 *src, size_t len)
 {
int i;
+
for (i = 0; i < len; i++)
dst[i] = cpu_to_be32(src[i]);
 }
@@ -283,6 +285,7 @@ static void cpu_to_be32_array(__be32 *dst, u32 *src, size_t 
len)
 static void be32_to_cpu_array(u32 *dst, __be32 *src, size_t len)
 {
int i;
+
for (i = 0; i < len; i++)
dst[i] = be32_to_cpu(src[i]);
 }
@@ -304,6 +307,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg)
 static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl)
 {
struct ctl_pkg *pkg = kzalloc(sizeof(*pkg), GFP_KERNEL);
+
if (!pkg)
return NULL;
pkg->ctl = ctl;
@@ -323,6 +327,7 @@ static void tb_ctl_tx_callback(struct tb_ring *ring, struct 
ring_frame *frame,
   bool canceled)
 {
struct ctl_pkg *pkg = container_of(frame, typeof(*pkg), frame);
+
tb_ctl_pkg_free(pkg);
 }
 
@@ -338,6 +343,7 @@ static int tb_ctl_tx(struct tb_ctl *ctl, void *data, size_t 
len,
 {
int res;
struct ctl_pkg *pkg;
+
if (len % 4 != 0) { /* required for le->be conversion */
tb_ctl_WARN(ctl, "TX: invalid size: %zu\n", len);
return -EINVAL;
@@ -370,6 +376,7 @@ static void tb_ctl_handle_plug_event(struct tb_ctl *ctl,
 struct ctl_pkg *response)
 {
struct cfg_event_pkg *pkg = response->buffer;
+
u64 route = get_route(pkg->header);
 
if (check_header(response, sizeof(*pkg), TB_CFG_PKG_EVENT, route)) {
@@ -475,6 +482,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, hotplug_cb 
cb, void *cb_data)
 {
int i;
struct tb_ctl *ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
+
if (!ctl)
return NULL;
ctl->nhi = nhi;
@@ -520,6 +528,7 @@ err:
 void tb_ctl_free(struct tb_ctl *ctl)
 {
int i;
+
if (ctl->rx)
ring_free(ctl->rx);
if (ctl->tx)
@@ -541,6 +550,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
 void tb_ctl_start(struct tb_ctl *ctl)
 {
int i;
+
tb_ctl_info(ctl, "control channel starting...\n");
ring_start(ctl->tx); /* is used to ack hotplug packets, start first */
ring_start(ctl->rx);
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 0dde34e..9ff432b 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -39,6 +39,7 @@ static int tb_eeprom_active(struct tb_switch *sw, bool enable)
 {
struct tb_eeprom_ctl ctl;
int res = tb_eeprom_ctl_read(sw, );
+
if (res)
return res;
if (enable) {
@@ -68,6 +69,7 @@ static int tb_eeprom_transfer(struct tb_switch *sw, struct 
tb_eeprom_ctl *ctl,
  enum tb_eeprom_transfer direction)
 {
int res;
+
if (direction == TB_EEPROM_OUT) {
res = tb_eeprom_ctl_write(sw, ctl);
if (res)
@@ -94,6 +96,7 @@ static int tb_eeprom_out(struct tb_switch *sw, u8 v

[PATCH] staging: netlogic: Coding Style Alignment should match open parenthesis

2015-12-12 Thread Benjamin Young
Fixed alignment issues with parenthesis so the code is easier to read.

Signed-off-by: Benjamin Young 
---
 drivers/staging/netlogic/platform_net.c |  12 +--
 drivers/staging/netlogic/xlr_net.c  | 159 +---
 2 files changed, 91 insertions(+), 80 deletions(-)

diff --git a/drivers/staging/netlogic/platform_net.c 
b/drivers/staging/netlogic/platform_net.c
index 7806c2b..f71e42a 100644
--- a/drivers/staging/netlogic/platform_net.c
+++ b/drivers/staging/netlogic/platform_net.c
@@ -121,8 +121,8 @@ static struct platform_device *gmac_controller2_init(void 
*gmac0_addr)
ndata1.phy_addr[mac] = mac + 4 + 0x10;
 
xlr_resource_init(_net1_res[mac * 2],
-   xlr_gmac_offsets[mac + 4],
-   xlr_gmac_irqs[mac + 4]);
+ xlr_gmac_offsets[mac + 4],
+ xlr_gmac_irqs[mac + 4]);
}
xlr_net_dev1.num_resources = 8;
 
@@ -169,7 +169,7 @@ static void xls_gmac_init(void)
xlr_net_dev0.num_resources = 2;
 
xlr_resource_init(_net0_res[0], xlr_gmac_offsets[0],
-   xlr_gmac_irqs[0]);
+ xlr_gmac_irqs[0]);
platform_device_register(_net_dev0);
 
/* second block is XAUI, not supported yet */
@@ -182,8 +182,8 @@ static void xls_gmac_init(void)
ndata0.phy_addr[mac] = mac + 0x10;
 
xlr_resource_init(_net0_res[mac * 2],
-   xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_offsets[mac],
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
platform_device_register(_net_dev0);
@@ -223,7 +223,7 @@ static void xlr_gmac_init(void)
ndata0.tx_stnid[mac] = FMN_STNID_GMAC0_TX0 + mac;
ndata0.phy_addr[mac] = mac;
xlr_resource_init(_net0_res[mac * 2], xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
xlr_net_dev0.resource = xlr_net0_res;
diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index ac93e63..7c44acf 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -69,8 +69,8 @@ static inline u32 xlr_nae_rdreg(u32 __iomem *base, unsigned 
int reg)
return __raw_readl(base + reg);
 }
 
-static inline void xlr_reg_update(u32 *base_addr,
-   u32 off, u32 val, u32 mask)
+static inline void xlr_reg_update(u32 *base_addr, u32 off,
+ u32 val, u32 mask)
 {
u32 tmp;
 
@@ -122,8 +122,8 @@ static inline unsigned char *xlr_alloc_skb(void)
return skb->data;
 }
 
-static void xlr_net_fmn_handler(int bkt, int src_stnid, int size,
-   int code, struct nlm_fmn_msg *msg, void *arg)
+static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, int code,
+   struct nlm_fmn_msg *msg, void *arg)
 {
struct sk_buff *skb;
void *skb_data = NULL;
@@ -247,7 +247,7 @@ static int xlr_net_stop(struct net_device *ndev)
 }
 
 static void xlr_make_tx_desc(struct nlm_fmn_msg *msg, unsigned long addr,
-   struct sk_buff *skb)
+struct sk_buff *skb)
 {
unsigned long physkb = virt_to_phys(skb);
int cpu_core = nlm_core_id();
@@ -275,7 +275,7 @@ static void __maybe_unused xlr_wakeup_queue(unsigned long 
dev)
 }
 
 static netdev_tx_t xlr_net_start_xmit(struct sk_buff *skb,
-   struct net_device *ndev)
+ struct net_device *ndev)
 {
struct nlm_fmn_msg msg;
struct xlr_net_priv *priv = netdev_priv(ndev);
@@ -304,10 +304,10 @@ static void xlr_hw_set_mac_addr(struct net_device *ndev)
 
/* set mac station address */
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0,
-   ((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) |
-   (ndev->dev_addr[3] << 8) | (ndev->dev_addr[2])));
+((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) |
+(ndev->dev_addr[3] << 8) | (ndev->dev_addr[2])));
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0 + 1,
-   ((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16)));
+((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16)));
 
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2, 0x);
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2 + 1, 0x);
@@ -315,12 +315,12 @@ stat

Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2015-12-12 Thread Benjamin Young
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 
> ---
>  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 = >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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2015-12-12 Thread Benjamin Young
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 
---
 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 = >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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: netlogic: Coding Style Alignment should match open parenthesis

2015-12-12 Thread Benjamin Young
Fixed alignment issues with parenthesis so the code is easier to read.

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/netlogic/platform_net.c |  12 +--
 drivers/staging/netlogic/xlr_net.c  | 159 +---
 2 files changed, 91 insertions(+), 80 deletions(-)

diff --git a/drivers/staging/netlogic/platform_net.c 
b/drivers/staging/netlogic/platform_net.c
index 7806c2b..f71e42a 100644
--- a/drivers/staging/netlogic/platform_net.c
+++ b/drivers/staging/netlogic/platform_net.c
@@ -121,8 +121,8 @@ static struct platform_device *gmac_controller2_init(void 
*gmac0_addr)
ndata1.phy_addr[mac] = mac + 4 + 0x10;
 
xlr_resource_init(_net1_res[mac * 2],
-   xlr_gmac_offsets[mac + 4],
-   xlr_gmac_irqs[mac + 4]);
+ xlr_gmac_offsets[mac + 4],
+ xlr_gmac_irqs[mac + 4]);
}
xlr_net_dev1.num_resources = 8;
 
@@ -169,7 +169,7 @@ static void xls_gmac_init(void)
xlr_net_dev0.num_resources = 2;
 
xlr_resource_init(_net0_res[0], xlr_gmac_offsets[0],
-   xlr_gmac_irqs[0]);
+ xlr_gmac_irqs[0]);
platform_device_register(_net_dev0);
 
/* second block is XAUI, not supported yet */
@@ -182,8 +182,8 @@ static void xls_gmac_init(void)
ndata0.phy_addr[mac] = mac + 0x10;
 
xlr_resource_init(_net0_res[mac * 2],
-   xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_offsets[mac],
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
platform_device_register(_net_dev0);
@@ -223,7 +223,7 @@ static void xlr_gmac_init(void)
ndata0.tx_stnid[mac] = FMN_STNID_GMAC0_TX0 + mac;
ndata0.phy_addr[mac] = mac;
xlr_resource_init(_net0_res[mac * 2], xlr_gmac_offsets[mac],
-   xlr_gmac_irqs[mac]);
+ xlr_gmac_irqs[mac]);
}
xlr_net_dev0.num_resources = 8;
xlr_net_dev0.resource = xlr_net0_res;
diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index ac93e63..7c44acf 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -69,8 +69,8 @@ static inline u32 xlr_nae_rdreg(u32 __iomem *base, unsigned 
int reg)
return __raw_readl(base + reg);
 }
 
-static inline void xlr_reg_update(u32 *base_addr,
-   u32 off, u32 val, u32 mask)
+static inline void xlr_reg_update(u32 *base_addr, u32 off,
+ u32 val, u32 mask)
 {
u32 tmp;
 
@@ -122,8 +122,8 @@ static inline unsigned char *xlr_alloc_skb(void)
return skb->data;
 }
 
-static void xlr_net_fmn_handler(int bkt, int src_stnid, int size,
-   int code, struct nlm_fmn_msg *msg, void *arg)
+static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, int code,
+   struct nlm_fmn_msg *msg, void *arg)
 {
struct sk_buff *skb;
void *skb_data = NULL;
@@ -247,7 +247,7 @@ static int xlr_net_stop(struct net_device *ndev)
 }
 
 static void xlr_make_tx_desc(struct nlm_fmn_msg *msg, unsigned long addr,
-   struct sk_buff *skb)
+struct sk_buff *skb)
 {
unsigned long physkb = virt_to_phys(skb);
int cpu_core = nlm_core_id();
@@ -275,7 +275,7 @@ static void __maybe_unused xlr_wakeup_queue(unsigned long 
dev)
 }
 
 static netdev_tx_t xlr_net_start_xmit(struct sk_buff *skb,
-   struct net_device *ndev)
+ struct net_device *ndev)
 {
struct nlm_fmn_msg msg;
struct xlr_net_priv *priv = netdev_priv(ndev);
@@ -304,10 +304,10 @@ static void xlr_hw_set_mac_addr(struct net_device *ndev)
 
/* set mac station address */
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0,
-   ((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) |
-   (ndev->dev_addr[3] << 8) | (ndev->dev_addr[2])));
+((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) |
+(ndev->dev_addr[3] << 8) | (ndev->dev_addr[2])));
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0 + 1,
-   ((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16)));
+((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16)));
 
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2, 0x);
xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2 + 1, 0x)

Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2015-12-12 Thread Benjamin Young
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 <youngc...@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 = >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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !

2015-12-12 Thread Benjamin Young
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 <youngc...@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 = >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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could be written "!r"

2015-12-11 Thread Benjamin Young
Fixed coding style for null comparisons in goldfish_audio.c to be more 
consistant
with the rest of the kernel coding style

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index f1e1838..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix - spaces preferred around that '+'

2015-12-11 Thread Benjamin Young
Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-11 Thread Benjamin Young
On Fri, Dec 11, 2015 at 12:14:17PM +0530, Sudip Mukherjee wrote:
> On Thu, Dec 10, 2015 at 06:31:09PM -0500, Benjamin Young wrote:
> > From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
> > From: Benjamin Young 
> > Date: Thu, 10 Dec 2015 17:31:00 -0500
> > Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred 
> > around
> >  that '+'
> 
> Regarding all the three patches: The above header information should not
> be here.
> 
> Regarding this patch: This is a repeat of the previous patch with the
> subject of the next patch.
> 
> regards
> sudip

Sorry about the duplicate emails with one having the wrong subject line.  My 
fingers betrayed me and hit
Enter before I was done editing

As for the header information, i will remove it and send out the patches

Thank you again for being so pacient, since i am a noobie to kernel development

Thanks,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix - spaces preferred around that '+'

2015-12-11 Thread Benjamin Young
Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could be written "!r"

2015-12-11 Thread Benjamin Young
Fixed coding style for null comparisons in goldfish_audio.c to be more 
consistant
with the rest of the kernel coding style

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index f1e1838..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-11 Thread Benjamin Young
On Fri, Dec 11, 2015 at 12:14:17PM +0530, Sudip Mukherjee wrote:
> On Thu, Dec 10, 2015 at 06:31:09PM -0500, Benjamin Young wrote:
> > From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
> > From: Benjamin Young <youngc...@gmail.com>
> > Date: Thu, 10 Dec 2015 17:31:00 -0500
> > Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred 
> > around
> >  that '+'
> 
> Regarding all the three patches: The above header information should not
> be here.
> 
> Regarding this patch: This is a repeat of the previous patch with the
> subject of the next patch.
> 
> regards
> sudip

Sorry about the duplicate emails with one having the wrong subject line.  My 
fingers betrayed me and hit
Enter before I was done editing

As for the header information, i will remove it and send out the patches

Thank you again for being so pacient, since i am a noobie to kernel development

Thanks,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-10 Thread Benjamin Young
>From f279a9e98b35301690abb39271367ecb0f611aff Mon Sep 17 00:00:00 2001
From: Benjamin Young 
Date: Thu, 10 Dec 2015 17:35:33 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could
 be written "!r"

Fixed coding style for null comparisons in goldfish_audio.c to be more 
consistant
with the rest of the kernel coding style

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index f1e1838..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-10 Thread Benjamin Young
>From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
From: Benjamin Young 
Date: Thu, 10 Dec 2015 17:31:00 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred around
 that '+'

Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix - spaces preferred around that '+'

2015-12-10 Thread Benjamin Young
>From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
From: Benjamin Young 
Date: Thu, 10 Dec 2015 17:31:00 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred around
 that '+'

Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

2015-12-10 Thread Benjamin Young
On Thu, Dec 10, 2015 at 12:43:19PM +0530, Sudip Mukherjee wrote:
> On Wed, Dec 09, 2015 at 03:46:02PM -0800, Benjamin Young wrote:
> > From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
> > From: Benjamin Young 
> > Date: Wed, 9 Dec 2015 13:45:00 -0800
> > Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
> >  goldfish_audio.c
> 
> This should not be here.
> You have not given in commit message and you are doing multiple changes
> in this patch. Please split them into separate patch, each patch doing
> only a single type of change.
> 
> regards
> sudip

Thanks Sudip I will fix this by creating two new patches.
One for the comparison to null checks and the other for space between operators.

Was there anything else which I could improve on for this commit?

Thanks,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix - spaces preferred around that '+'

2015-12-10 Thread Benjamin Young
>From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
From: Benjamin Young <youngc...@gmail.com>
Date: Thu, 10 Dec 2015 17:31:00 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred around
 that '+'

Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-10 Thread Benjamin Young
>From 4b8ce6b3bd7effdfff2c95fbeb4a20cb93d5e9e5 Mon Sep 17 00:00:00 2001
From: Benjamin Young <youngc...@gmail.com>
Date: Thu, 10 Dec 2015 17:31:00 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix - spaces preferred around
 that '+'

Helped improve coding style to make arithemethic easier to read

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..f1e1838 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could

2015-12-10 Thread Benjamin Young
>From f279a9e98b35301690abb39271367ecb0f611aff Mon Sep 17 00:00:00 2001
From: Benjamin Young <youngc...@gmail.com>
Date: Thu, 10 Dec 2015 17:35:33 -0500
Subject: [PATCH] staging: goldfish: Coding Style Fix Comparison to NULL could
 be written "!r"

Fixed coding style for null comparisons in goldfish_audio.c to be more 
consistant
with the rest of the kernel coding style

Signed-off-by: Benjamin Young <youngc...@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index f1e1838..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

2015-12-10 Thread Benjamin Young
On Thu, Dec 10, 2015 at 12:43:19PM +0530, Sudip Mukherjee wrote:
> On Wed, Dec 09, 2015 at 03:46:02PM -0800, Benjamin Young wrote:
> > From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
> > From: Benjamin Young <youngc...@gmail.com>
> > Date: Wed, 9 Dec 2015 13:45:00 -0800
> > Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
> >  goldfish_audio.c
> 
> This should not be here.
> You have not given in commit message and you are doing multiple changes
> in this patch. Please split them into separate patch, each patch doing
> only a single type of change.
> 
> regards
> sudip

Thanks Sudip I will fix this by creating two new patches.
One for the comparison to null checks and the other for space between operators.

Was there anything else which I could improve on for this commit?

Thanks,
Benjamin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

2015-12-09 Thread Benjamin Young
>From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
From: Benjamin Young 
Date: Wed, 9 Dec 2015 13:45:00 -0800
Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
 goldfish_audio.c

Signed-off-by: Benjamin Young 
---
 drivers/staging/goldfish/goldfish_audio.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fixed coding style problems based on checkpatch.pl for goldfish_audio.c

2015-12-09 Thread Benjamin Young
>From f18a3e5f155f5258d2d19ac6b56bfaafa2ad470b Mon Sep 17 00:00:00 2001
From: Benjamin Young <youngc...@gmail.com>
Date: Wed, 9 Dec 2015 13:45:00 -0800
Subject: [PATCH] Fixed coding style problems based on checkpatch.pl for
 goldfish_audio.c

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

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index b0927e4..364fdcd 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -63,7 +63,7 @@ struct goldfish_audio {
 #define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
 #define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
 #define AUDIO_WRITE64(data, addr, addr2, x)\
-   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base+addr2))
+   (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
@@ -280,12 +280,12 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
platform_set_drvdata(pdev, data);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (r == NULL) {
+   if (!r) {
dev_err(>dev, "platform_get_resource failed\n");
return -ENODEV;
}
data->reg_base = devm_ioremap(>dev, r->start, PAGE_SIZE);
-   if (data->reg_base == NULL)
+   if (!data->reg_base)
return -ENOMEM;
 
data->irq = platform_get_irq(pdev, 0);
@@ -295,7 +295,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(>dev,
COMBINED_BUFFER_SIZE, _addr, GFP_KERNEL);
-   if (data->buffer_virt == NULL) {
+   if (!data->buffer_virt) {
dev_err(>dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/