lkml.org 
[lkml]   [2013]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/10] usb: musb: ux500: harden checks for platform data
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-04-24 17:01    [W:0.063 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site