Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932820Ab1D0NWM (ORCPT ); Wed, 27 Apr 2011 09:22:12 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:50918 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932790Ab1D0NWE (ORCPT ); Wed, 27 Apr 2011 09:22:04 -0400 Message-ID: <4DB81874.1060904@pengutronix.de> Date: Wed, 27 Apr 2011 15:21:56 +0200 From: Marc Kleine-Budde Organization: Pengutronix User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: Subhasish Ghosh CC: Wolfgang Grandegger , sachi@mistralsolutions.com, davinci-linux-open-source@linux.davincidsp.com, Netdev@vger.kernel.org, nsekhar@ti.com, open list , CAN NETWORK DRIVERS , m-watkins@ti.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/1] can: add pruss CAN driver. References: <1303474267-6344-1-git-send-email-subhasish@mistralsolutions.com> <1303474267-6344-2-git-send-email-subhasish@mistralsolutions.com> <4DB1A3B7.7060300@pengutronix.de> <4DB5D452.9050500@grandegger.com> <46D523E49EFF489F9B088AE7B9CD7286@subhasishg> In-Reply-To: <46D523E49EFF489F9B088AE7B9CD7286@subhasishg> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig457819A39003E5994EC492FA" X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3087 Lines: 92 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig457819A39003E5994EC492FA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 04/27/2011 03:08 PM, Subhasish Ghosh wrote: >>>> +static u32 pruss_intc_init[19][3] =3D { >>>> + {PRUSS_INTC_POLARITY0, PRU_INTC_REGMAP_MASK, 0xFFFFFFFF}, >>>> + {PRUSS_INTC_POLARITY1, PRU_INTC_REGMAP_MASK, 0xFFFFFFFF}, >>>> + {PRUSS_INTC_TYPE0, PRU_INTC_REGMAP_MASK, 0x1C000000}, >>>> + {PRUSS_INTC_TYPE1, PRU_INTC_REGMAP_MASK, 0}, >>>> + {PRUSS_INTC_GLBLEN, 0, 1}, >>>> + {PRUSS_INTC_HOSTMAP0, PRU_INTC_REGMAP_MASK, 0x03020100}, >>>> + {PRUSS_INTC_HOSTMAP1, PRU_INTC_REGMAP_MASK, 0x07060504}, >>>> + {PRUSS_INTC_HOSTMAP2, PRU_INTC_REGMAP_MASK, 0x0000908}, >>>> + {PRUSS_INTC_CHANMAP0, PRU_INTC_REGMAP_MASK, 0}, >>>> + {PRUSS_INTC_CHANMAP8, PRU_INTC_REGMAP_MASK, 0x00020200}, >>>> + {PRUSS_INTC_STATIDXCLR, 0, 32}, >>>> + {PRUSS_INTC_STATIDXCLR, 0, 19}, >>>> + {PRUSS_INTC_ENIDXSET, 0, 19}, >>>> + {PRUSS_INTC_STATIDXCLR, 0, 18}, >>>> + {PRUSS_INTC_ENIDXSET, 0, 18}, >>>> + {PRUSS_INTC_STATIDXCLR, 0, 34}, >>>> + {PRUSS_INTC_ENIDXSET, 0, 34}, >>>> + {PRUSS_INTC_ENIDXSET, 0, 32}, >>>> + {PRUSS_INTC_HOSTINTEN, 0, 5} >>> >>> please add "," >> >> Also a struct to describe each entry would improve readability. >> Then you could also use ARRAY_SIZE. >=20 > SG _ I could not follow this, are you recommending that I create a > structure with three variables and then create > an array for it. > something like: >=20 > const static struct [] =3D { > { > unsigned int reg_base; > unsigned int reg_mask; > unsigned int reg_val; > }, > ... > }; I think this isn't valid C. It should look like this: struct pruss_intc_init { unsigned long reg_base; u32 reg_mask; u32 reg+val; }; static const struct pruss_intc_init pruss_initc_init[] =3D { { .reg_base =3D 0xdeadbeef, .reg_mask =3D 0xaa, .reg_val =3D 0x55 }, ... }; I'm not sure about the datatype of reg_base. I haven't looked at the code that uses this array. cheers, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --------------enig457819A39003E5994EC492FA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk24GHcACgkQjTAFq1RaXHNamACeIPjcWMJsbNRFgTpwVzPVrdnW OcsAoIrkJR0hCIzse0P53HXDqmq13Ddc =gr7V -----END PGP SIGNATURE----- --------------enig457819A39003E5994EC492FA-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/