From: Timur Tabi <timur@freescale.com>
To: Singh Sandeep-B37400 <B37400@freescale.com>
Cc: Aggrwal Poonam-B10812 <B10812@freescale.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [2/3][PATCH][upstream] TDM Framework
Date: Tue, 24 Jul 2012 09:43:11 -0500 [thread overview]
Message-ID: <500EB47F.1040903@freescale.com> (raw)
In-Reply-To: <3F1D9DCAAB49B94D88DBE05911FA4E6E50ED27@039-SN1MPN1-006.039d.mgd.msft.net>
Singh Sandeep-B37400 wrote:
>> +int tdm_adap_send(struct tdm_adapter *adap, void **buf, int count) {
>> + int res;
>> +
>> + if (adap->algo->tdm_write)
>> + res = adap->algo->tdm_write(adap, buf, count);
>
> Why does tdm_write() return a u32? And shouldn't 'res' also be a u32, to make tdm_write()?
> [Sandeep] tdm_write() returns number of bytes written. You are right, 'res' should be declared as u32
Then it should return an unsigned int. You should used a sized integer
type only when the size really matters (e.g. hardware registers or packed
fields in a structure).
>> +/* tdm_adapter_mode is to define in mode of the device */ enum
>> +tdm_adapter_mode {
>> + TDM_ADAPTER_MODE_NONE = 0x00,
>> + TDM_ADAPTER_MODE_T1 = 0x01,
>> + TDM_ADAPTER_MODE_E1 = 0x02,
>> + TDM_ADAPTER_MODE_T1_RAW = 0x10,
>> + TDM_ADAPTER_MODE_E1_RAW = 0x20,
>
> Where did these numbers come from?
> [Sandeep] This is not related to any bit definition, just enum values.
Yes, but why these particular numbers? Also, do they really need to be an
enum? Since you're defining hard values for each enum, you're not really
using them as an enum. Make these into macros.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2012-07-24 14:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 10:49 [2/3][PATCH][upstream] TDM Framework b37400
2012-07-23 10:49 ` [1/3][PATCH][upstream]Adding documentation for TDM b37400
2012-07-23 10:49 ` [3/3][PATCH][upstream]Added TDM device support and Freescale Starlite driver b37400
2012-07-23 12:32 ` [1/3][PATCH][upstream]Adding documentation for TDM David Laight
2012-07-24 15:12 ` Aggrwal Poonam-B10812
2012-07-25 8:44 ` David Laight
2012-07-25 12:08 ` Aggrwal Poonam-B10812
2012-07-23 16:33 ` [2/3][PATCH][upstream] TDM Framework Tabi Timur-B04825
2012-07-24 13:22 ` Singh Sandeep-B37400
2012-07-24 14:43 ` Timur Tabi [this message]
2012-07-24 23:43 ` Michael Ellerman
2012-07-25 2:40 ` Tabi Timur-B04825
2012-07-25 5:18 ` Michael Ellerman
2012-07-26 21:28 ` Timur Tabi
2012-07-26 22:09 ` Scott Wood
2012-07-26 10:49 ` Singh Sandeep-B37400
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=500EB47F.1040903@freescale.com \
--to=timur@freescale.com \
--cc=B10812@freescale.com \
--cc=B37400@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).