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

From: Felipe Balbi
Date: Wed Apr 24 2013 - 10:26:59 EST


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 = data->dma_rx_param_array;
> >>>+ param_array = (data) ? data->dma_rx_param_array : NULL;
>
> >> Why enclose a simple variable in parens?
>
> >Because 'data' is a pointer, so it contains a memory location,

heh, I don't think you fully understood Sergei's comment. He's asking
why you used:

param_array = (data) ? data->dma_rx_param_array : NULL;

instead of:

param_array = data ? data->dma_rx_param_array : NULL;

He's saying, correctly so, that the parens around data is unnecessary.

--
balbi

Attachment: signature.asc
Description: Digital signature