Re: [PATCH v6 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
On Thu, Jan 17, 2013 at 8:01 AM, Peter Chen peter.c...@freescale.com wrote: /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ - if (!cpu_is_mx51()) { + if (!strcmp(pdev-id_entry-name, imx-udc-mx27)) {]] Shouldn't this be: if (!strcmp(pdev-id_entry-name, imx-udc-mx51)) ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v6 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
Hi, Fabio Estevam writes: On Thu, Jan 17, 2013 at 8:01 AM, Peter Chen peter.c...@freescale.com wrote: /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ - if (!cpu_is_mx51()) { + if (!strcmp(pdev-id_entry-name, imx-udc-mx27)) {]] Shouldn't this be: if (!strcmp(pdev-id_entry-name, imx-udc-mx51)) The equivalent of !cpu_is_mx51() would be strcmp(pdev-id_entry-name, imx-udc-mx51) (without the '!') meaning id_entry-name is different from imx-udc-mx51. I personally hate the '!strcmp()' notation and prefer 'strcmp() == 0' though they are technically equivalent. Using '==' makes it much clearer to the reader what is intended. !strcmp() lets one assume that it is true when the comparison fails, though actually the opposite is true. Lothar Waßmann -- ___ Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Geschäftsführer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | i...@karo-electronics.de ___ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v6 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
On Thu, Jan 17, 2013 at 9:25 AM, Lothar Waßmann l...@karo-electronics.de wrote: The equivalent of !cpu_is_mx51() would be strcmp(pdev-id_entry-name, imx-udc-mx51) (without the '!') meaning id_entry-name is different from imx-udc-mx51. Yes, agree. strcmp(pdev-id_entry-name, imx-udc-mx51) is also better than !strcmp(pdev-id_entry-name, imx-udc-mx27)) because in the case of another soc entry gets added, let's say imx-udc-mxyy then !strcmp(pdev-id_entry-name, imx-udc-mx27)) will not correspond to !cpu_is_mx51() anymore. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v6 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
On Thu, Jan 17, 2013 at 12:43:23PM -0200, Fabio Estevam wrote: On Thu, Jan 17, 2013 at 9:25 AM, Lothar Waßmann l...@karo-electronics.de wrote: The equivalent of !cpu_is_mx51() would be strcmp(pdev-id_entry-name, imx-udc-mx51) (without the '!') meaning id_entry-name is different from imx-udc-mx51. Thanks, Lothar and Fabio, I will change, and send v7. Yes, agree. strcmp(pdev-id_entry-name, imx-udc-mx51) is also better than !strcmp(pdev-id_entry-name, imx-udc-mx27)) We just think this feature only belongs to imx-udc-mx27 type udc because in the case of another soc entry gets added, let's say imx-udc-mxyy then !strcmp(pdev-id_entry-name, imx-udc-mx27)) will not correspond to !cpu_is_mx51() anymore. -- Best Regards, Peter Chen ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev