lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Sep 2014 11:35:30 -0500
From:	German Rivera <German.Rivera@...escale.com>
To:	Joe Perches <joe@...ches.com>
CC:	<gregkh@...uxfoundation.org>, <arnd@...db.de>,
	<linux-kernel@...r.kernel.org>, <stuart.yoder@...escale.com>,
	<Kim.Phillips@...escale.com>, <scottwood@...escale.com>,
	<agraf@...e.de>, <linuxppc-release@...ux.freescale.net>
Subject: Re: [PATCH 1/4] drivers/bus: Added Freescale Management Complex APIs



On 09/11/2014 01:45 PM, Joe Perches wrote:
>
>> diff --git a/drivers/bus/fsl-mc/dpmng.c b/drivers/bus/fsl-mc/dpmng.c
> []
>> +int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info)
>> +{
>> +	struct mc_command cmd = { 0 };
>> +	int err;
>> +
>> +	cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION,
>> +					  DPMNG_CMDSZ_GET_VERSION,
>> +					  MC_CMD_PRI_LOW, 0);
>> +
>> +	err = mc_send_command(mc_io, &cmd);
>> +	if (!err)
>> +		DPMNG_RSP_GET_VERSION(cmd, mc_ver_info);
>> +
>> +	return err;
>
> I think it better style to read when the
> failure case is handled immediately by
> a return or a "goto out" and the successful
> case code is at the same indent level
>
> 	err = mc_send_command_(etc...)
> 	if (err)
> 		return err;
>
> 	DPMNG_RSP_GET_VERSION(cmd, mc_ver_info);
>
> 	return 0;
> }
>
Ok, I'll change this as suggested in the next respin.

>> diff --git a/drivers/bus/fsl-mc/dprc.c b/drivers/bus/fsl-mc/dprc.c
>
>> +int dprc_get_container_id(struct fsl_mc_io *mc_io, int *container_id)
>> +{
>> +	struct mc_command cmd = { 0 };
>> +	int err;
>> +
>> +	cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_CONT_ID,
>> +					  DPRC_CMDSZ_GET_CONT_ID,
>> +					  MC_CMD_PRI_LOW, 0);
>> +
>> +	err = mc_send_command(mc_io, &cmd);
>> +	if (!err)
>> +		DPRC_RSP_GET_CONTAINER_ID(cmd, *container_id);
>> +
>> +	return err;
>> +}
>
> Same sort of thing as above.
> Actively fail on err and proceed at the same indent
> level on success.
>
Yes, I'll change all occurrences of this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ