Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938511AbcLPAPz (ORCPT ); Thu, 15 Dec 2016 19:15:55 -0500 Received: from mail-db5eur01on0076.outbound.protection.outlook.com ([104.47.2.76]:61312 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936570AbcLPAPy (ORCPT ); Thu, 15 Dec 2016 19:15:54 -0500 From: Stuart Yoder To: Laurentiu Tudor , "gregkh@linuxfoundation.org" CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "agraf@suse.de" , "arnd@arndb.de" , Leo Li , Ioana Ciornei , "Catalin Horghidan" , Ruxandra Ioana Radulescu , Roy Pledge Subject: RE: [PATCH v3 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects Thread-Topic: [PATCH v3 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects Thread-Index: AQHSTCUbQT0mvsH2lkarEwd+zhdm5qD0haMAgBTCLMA= Date: Thu, 15 Dec 2016 16:36:43 +0000 Message-ID: References: <1480632094-3621-1-git-send-email-stuart.yoder@nxp.com> <1480632094-3621-4-git-send-email-stuart.yoder@nxp.com> <58415A74.6050604@nxp.com> In-Reply-To: <58415A74.6050604@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=stuart.yoder@nxp.com; x-originating-ip: [192.88.168.1] x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2638;7:xQezHLqArcRTIEQkRNcvjsdCQfK2LTXSfuZwg5Fqa/iqSPd3ry2w1pn4yMgXvDza77Bo7/1T+JGF1GebVVAsBtqNhqcDdU6YtXCcGXAx754Z/5doxENvMCQmEGs1fH5bFAnHRXQB0gXNC95BCBFG5pCe4pe0ozJSSUxUdlTVTMkw2SYBt1A6d+lViq4XaebOziBLbc9QYVrCzcTNC7TYLGNURqz9OG8TT/Y+ZTqUfLeHc97dL7RMdS3uiqRTazd9VfK472gcenh0G+LR6XxKX3Uh/+ftGfLVz7QZCiEDhGeuQXQtM1JGIWoV2ZHNBHuSUrI45jUFCwCTCY8gnL/1hBhkeqeM44go9hUKh0DaGXW89KKCNqpT668s1nK81c6mYwUI0g+q/j7TdfIwYfaUuHGX6Rd6gCc+9lxMQsz7Tt4lnwW0tmaAbmvRXe8aDv3ZufYlZjslzDz9BPffahnayA== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39860400002)(39840400002)(39450400003)(39410400002)(39850400002)(189002)(199003)(3660700001)(2950100002)(86362001)(5001770100001)(97736004)(81166006)(189998001)(101416001)(81156014)(305945005)(7736002)(105586002)(5660300001)(68736007)(3280700002)(7696004)(106356001)(106116001)(50986999)(8676002)(66066001)(2906002)(2900100001)(77096006)(74316002)(6116002)(229853002)(3846002)(76576001)(54356999)(122556002)(76176999)(102836003)(4326007)(2501003)(92566002)(8936002)(38730400001)(6436002)(33656002)(6506006)(25786008)(9686002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2638;H:VI1PR0401MB2638.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: c1afe9e5-5640-4126-572e-08d425088deb x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0401MB2638; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148)(6047074);SRVR:VI1PR0401MB2638;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2638; x-forefront-prvs: 0157DEB61B spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2016 16:36:43.5848 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2638 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uBG0G3YJ009851 Content-Length: 1258 Lines: 34 > > +#define DPIO_CMD(id) ((id << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION) > > Paranthesis around 'id'? In all cases these are opcode values and will never be an expression. If we really need to future proof these definitions, we should do it for all objects not just DPIO. I'd like to see consistency across objects and don't want to see DPIO gratuitously diverge. So, my suggestion is to have an offline discussion and if we think the change is needed, submit a patch for all objects currently supported. > > + /* prepare command */ > > + cmd.header = mc_encode_cmd_header(DPIO_CMDID_OPEN, > > + cmd_flags, > > + 0); > > + dpio_cmd = (struct dpio_cmd_open *)cmd.params; > > + dpio_cmd->dpio_id = cpu_to_le32(dpio_id); > > + > > + /* send command to mc*/ > > + err = mc_send_command(mc_io, &cmd); > > + if (err) > > + return err; > > + > > + /* retrieve response parameters */ > > + *token = mc_cmd_hdr_read_token(&cmd); > > Nit: maybe we should drop these repetitive "prepare / send / retrieve" comments > as the code is pretty self explanatory. The 'send' comment certainly isn't needed given that the function is 'mc_send_command()'. For the others, I think having some comment is helpful, even though a bit repetitive. Stuart