[PATCH 04/10] usb: musb: ux500: harden checks for platform data
Felipe Balbi
balbi at ti.com
Wed Apr 24 10:26:15 EDT 2013
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130424/be915c41/attachment.sig>
More information about the linux-arm-kernel
mailing list