Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbcLIV6i (ORCPT ); Fri, 9 Dec 2016 16:58:38 -0500 Received: from mout.web.de ([212.227.15.4]:51618 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbcLIV6g (ORCPT ); Fri, 9 Dec 2016 16:58:36 -0500 Subject: Re: md: Combine two kmalloc() calls into one in sb_equal() To: Bernd Schubert References: <71044708-c5e4-3a14-b162-dfc600311a60@fastmail.fm> Cc: linux-raid@vger.kernel.org, Shaohua Li , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Fri, 9 Dec 2016 22:58:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Fq9ZfCTT/huWLuRFNPHrGsX8xreovtlwwAa3rNrr2mkIwhX3T6/ dVANf0VO4UoutuzRLLNpsG7tXPFSXbBGPuhkb91SybKDqBknYGmVVpgI4zYxl7L/i8h0lVM h8k5Sv/iqqoCjDNYpiIDYVbSrVs/iTV4SZhxTffLYAjY+Qb03zynKSjGWIm1oWSVdEokzSS wFi4LEmyesUIpBf38rmbw== X-UI-Out-Filterresults: notjunk:1;V01:K0:bKASn37aUFw=:wV6P7v0x+HRu2hk7NsGAeU 5L8Niz8VSgW0PIz8cQrK9VIgKeZ2zGOI8t4nPJl9b1AbdP42BaKhioPHoVhehBgr4X1Jhjg9K +KOgyRqK2PbSDtUSaSQ81GBuBalKtnQEdqgOIGKbB66jWPOGeDVDdLQYzjgXwihgMrZYMOs69 h9dOAQGS+DAbBpxRAD0fHibAqqXtFCDGa11hTzfA5Xdg1D7fI8j/mHLvZSecrwIaSfiFlh2b1 AHe+kFLFAHP4bv/sD+dv0FKuG6UFPP4NVQ14sz5wYCkIkRhX8TOwj9eBr1kxNmTw4ak2GhKGn +E5++slTktQBnuYo3XR8NEKdZk3OV+IYKA8+UTiDg1BC8qg8UwM1GCJECdRp+HMtidHUsZx1N tAoeGdbpYgHa8cAFdmUBqTpzS/EpkOhNqohqxcLtbS4txD9b0Z0Gdkfd+Ag4tC+KgNR1VHSyG lxH8MB67uM0tRRpZl6NP4yEJZzYYJnKq9nj6Q0AHYyDSjCecv8EU9OugEFr85QKgW/lRgdRwz vA5k6kheugZtIRMheokP9M9LRpEGj/d9I45/gArXVazZArAAT0qMjSx3KDte52DGXcisrPBnt ZwMOTE9sFIodm1v4+1lqzdCCVBKLGlEeUaxP1zUbRxYhJLFBOuha9EOrb/Ja+hgcZ98/Afwlq Ic6hIFdmE3yWqbJrugDCI8uipCr/JfDziNKgyv4JegrxssppdeTVs+lKKUP826/GOgGXNv6Iw kFXIlT47lESWHk7esX4FSjOnS2Fm/PQLGF4WcFIDDuUqwHFLT2v7HbHSfbPiu2QUKO27jpMMg TELH2cX Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 296 Lines: 10 > Irrelevant, the variable is not used before checking it. * Will it be more appropriate to attempt another memory allocation only if the previous one succeeded already? * Can it be a bit more efficient to duplicate only the required data in a single function call before? Regards, Markus