Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Arnd Bergmann
On Wednesday 24 April 2013, Lee Jones wrote: > Yeah, I agree, although does it make a difference? > > Is it evaluated a second time, or does it take up extra cycles by being > enclosed in parentheses? > > Or is this just a coding style thing? Just coding style. I agree you should have no

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Felipe Balbi
On Wed, Apr 24, 2013 at 06:00:28PM +0400, Sergei Shtylyov wrote: > Hello. > > On 24-04-2013 10:53, Lee Jones wrote: > > >>> struct musb_hdrc_platform_data *plat = dev->platform_data; > >>>- struct ux500_musb_board_data *data = plat->board_data; > >>>+ struct ux500_musb_board_data *data; > >

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Sergei Shtylyov
Hello. On 24-04-2013 10:53, Lee Jones wrote: struct musb_hdrc_platform_data *plat = dev->platform_data; - struct ux500_musb_board_data *data = plat->board_data; + struct ux500_musb_board_data *data; - param_array = data->dma_rx_param_array; + param_array =

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Lee Jones
Hi Sergei, > > struct musb_hdrc_platform_data *plat = dev->platform_data; > >-struct ux500_musb_board_data *data = plat->board_data; > >+struct ux500_musb_board_data *data; > >-param_array = data->dma_rx_param_array; > >+param_array = (data) ? data->dma_rx_param_array : NULL;

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Lee Jones
Hi Sergei, struct musb_hdrc_platform_data *plat = dev-platform_data; -struct ux500_musb_board_data *data = plat-board_data; +struct ux500_musb_board_data *data; -param_array = data-dma_rx_param_array; +param_array = (data) ? data-dma_rx_param_array : NULL; Why

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Sergei Shtylyov
Hello. On 24-04-2013 10:53, Lee Jones wrote: struct musb_hdrc_platform_data *plat = dev-platform_data; - struct ux500_musb_board_data *data = plat-board_data; + struct ux500_musb_board_data *data; - param_array = data-dma_rx_param_array; + param_array =

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Felipe Balbi
On Wed, Apr 24, 2013 at 06:00:28PM +0400, Sergei Shtylyov wrote: Hello. On 24-04-2013 10:53, Lee Jones wrote: struct musb_hdrc_platform_data *plat = dev-platform_data; - struct ux500_musb_board_data *data = plat-board_data; + struct ux500_musb_board_data *data; - param_array =

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-24 Thread Arnd Bergmann
On Wednesday 24 April 2013, Lee Jones wrote: Yeah, I agree, although does it make a difference? Is it evaluated a second time, or does it take up extra cycles by being enclosed in parentheses? Or is this just a coding style thing? Just coding style. I agree you should have no parentheses

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-23 Thread Sergei Shtylyov
Hello. On 04/23/2013 07:03 PM, Lee Jones wrote: In its current state, the ux500-musb driver uses platform data pointers blindly with no prior checking. If no platform data pointer is passed this will Oops the kernel. In this patch we ensure platform data and board data are present prior to

[PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-23 Thread Lee Jones
In its current state, the ux500-musb driver uses platform data pointers blindly with no prior checking. If no platform data pointer is passed this will Oops the kernel. In this patch we ensure platform data and board data are present prior to using them. Cc: Felipe Balbi Cc:

[PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-23 Thread Lee Jones
In its current state, the ux500-musb driver uses platform data pointers blindly with no prior checking. If no platform data pointer is passed this will Oops the kernel. In this patch we ensure platform data and board data are present prior to using them. Cc: Felipe Balbi ba...@ti.com Cc:

Re: [PATCH 04/10] usb: musb: ux500: harden checks for platform data

2013-04-23 Thread Sergei Shtylyov
Hello. On 04/23/2013 07:03 PM, Lee Jones wrote: In its current state, the ux500-musb driver uses platform data pointers blindly with no prior checking. If no platform data pointer is passed this will Oops the kernel. In this patch we ensure platform data and board data are present prior to