[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <566EAA34.5000301@users.sourceforge.net>
Date: Mon, 14 Dec 2015 12:38:28 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: Johannes Thumshirn <jthumshirn@...e.de>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in
iscsi_set_default_param() directly
> @@ -127,9 +127,8 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para
> char *name, char *value, u8 phase, u8 scope, u8 sender,
> u16 type_range, u8 use)
> {
> - struct iscsi_param *param = NULL;
> + struct iscsi_param *param;
>
> param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL);
> if (!param) {
> pr_err("Unable to allocate memory for parameter.\n");
>
>
> This way it would be _far_ more readable.
I guess that there are some opinions available for this implementation detail.
> IMHO one should have a 1 action per line of code style
How often do you care for such style issues?
> and only assign values in at declaration time if really necessary.
Which is or might become the official Linux coding style recommendation
for this aspect?
> But what is the benefit from this? Is it fixing a (hypothetical) bug?
I find the shown null pointer initialisation just needless.
Regards,
Markus
--
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