From patchwork Sat Dec 12 14:34:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7834951 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3EEA6BEEE1 for ; Sat, 12 Dec 2015 14:35:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58CAF203AE for ; Sat, 12 Dec 2015 14:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8AF7F203AD for ; Sat, 12 Dec 2015 14:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752095AbbLLOfA (ORCPT ); Sat, 12 Dec 2015 09:35:00 -0500 Received: from mout.web.de ([212.227.17.12]:52644 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbbLLOe6 (ORCPT ); Sat, 12 Dec 2015 09:34:58 -0500 Received: from [192.168.1.2] ([78.49.180.156]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0Ljaei-1aeu9O1wqG-00bazM; Sat, 12 Dec 2015 15:34:54 +0100 Subject: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, "Nicholas A. Bellinger" References: <566ABCD9.1060404@users.sourceforge.net> <566C2F7B.6030704@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <566C308A.6000109@users.sourceforge.net> Date: Sat, 12 Dec 2015 15:34:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <566C2F7B.6030704@users.sourceforge.net> X-Provags-ID: V03:K0:EMD1Hktd1yQBEBPrALCnGCd6r55CuCKz3H82kbCEyCc3Fs14l3n qVsbXMPMEEuXDk5GcadatmZBGvvcl4gFFJB+rwlZvg0aX9aCHL6cyqbjjhlOK6susDv2XC2 J49PgjEAKqhIYZOhanluhKHZqtJ0LMTvlmoQFgXIcDfuPGmCaM1VZxQWOb8i+rzrw7+0inA bFXydVrNhNYfNh7syOs7A== X-UI-Out-Filterresults: notjunk:1; V01:K0:nOmRFLu3zzk=:kGo0V7kPEKkKOkzHr94vHJ Zel/t+fwWeFnZHTnBZ1niChYvSaoIPl7iUzi58GMa9qcf12HvmnP8CPCaZtDzfonKPAzTrTFx xvzEKnAT8StaN1e8c5kywkBjRNZqTSK5ptgtRCAyYUHrrnetzhVA7LVPr83Yog9Sy1RKlDSAV hMBvhFytfAsT2goN/b3WyV9V1Yy63isgkGdYDDe8ptxNDwLsxgMZhEO/jop3Pjq/OkNRg5JQn RpFcQDt7gIfAFDiluH/R6OZBGkZp4l5Zzul+kA/TmMtYrwr4xj+CGtO1FJO+ft9HpgWcmXBwH /scaXvUek9iM+IENzawIxYjgHa3VDB0YLz2nMx/M3GA8iC3vzpCm0cetECUkCSP25wSNcBp0F 7o7AD9KIsqbPnFDqQFZ2M6vCMdfNIQ3KiOiUBqhPuatsvwQxbBDKcMn7Ihq9iM9W+NWOUyXw2 gBM77JzAt+K6SSyLMO3WS4SpymCnjxB2yALOo1OEeuSF3jfkgPZU9ois4Z5yyi9J5IS2fzeBq LwzuoCcZE3MmasYzNv8yxbfW8HXnArnLSouIYOOaX0KNRRcw0Uf5FaMsHpaFlvbk+ChwZUG0b LirWUi2aeupJf7ynE2VndnMfRCkIK1oK4p+Ol5t8ffcRw795J+u1axjhMx6FFDiZzJFc/UDvq bLtckuaSL/dCFA4eO2FOq1vS0yDj0rdEQcVekK0FcMslBbcc4ZxEnY0z+gMN5zZu7dHJG4uxT OxFoxEXiEsMsQDjNrYGcZZOxK9rgvwZB6oezFeoLonSfbkdhPaWGuSscw8gk1hNj4lcJPsweh Uv46Br7 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 12 Dec 2015 11:36:02 +0100 Omit the unnecessary setting to a null pointer for the variable "param" at the beginning of the function "iscsi_set_default_param" because it can be directly initialized with the return value from the function "kzalloc". Signed-off-by: Markus Elfring --- drivers/target/iscsi/iscsi_target_parameters.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 3a1f9a7..0a8bd3f 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c @@ -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 = kzalloc(sizeof(*param), GFP_KERNEL); - param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL); if (!param) { pr_err("Unable to allocate memory for parameter.\n"); goto out;