Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3604541imu; Sat, 24 Nov 2018 07:36:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/U3svqBSs8u3HD/P/72D9XX8f5QmmgCeQUDVEj0Uhqj7oqlr+CmbZu0PnXYNRUr9TMOyxyO X-Received: by 2002:a63:2507:: with SMTP id l7mr17513712pgl.22.1543073793366; Sat, 24 Nov 2018 07:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543073793; cv=none; d=google.com; s=arc-20160816; b=a8G8ATtC8vrsU85JDpkdgTEF9IDZr7i+TEcmf/JVhOFGHIQaLe7BiG2A31svUr1Q9L 3EDOqOFNZtHs8tJ86fz+tf3sF9wypBjstEZ6W22CpHNQpVKpaRMuHB72kjilrgtUmBBI 5xL/CxdwUSUGDzdLtuGvDqV8PbBCzxmHMBLIYijFyupWGKqFGnYmrqBXvTLKSd/bx2lJ xFI3ynrAzPWf+zLS29LyhDEvuOqFe2D5ePrfucw1ry5KsuQXixKgVQexCmRrNJACqYXO NqgfeuUTST08PanF8QEhbWXc/gEm3TUAZ5ofe8+8Jr0RfUG1agl0Lp6MCjOMZSZyVuLv 1IPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature; bh=/FuY6dgIuspQHr57QcxDIROVOnk4ZxSYqUTFxv9J2GE=; b=DOrVe2rR3fz5UFvlRorwMqeGQ8Ntr/I3Ix0udEgCQgsTMIKjq7ZnvL613KyNVBnwzF NMGmwllMVJLS/TzJ8arupuP9GCV8UFNQEpMN6M/gcpu9ZYmOX5vxIjdNSD+GuBYPKAtA xRFNVY8Vqqzyj12dKjgRi42ptKc+rGUEif0H/K7JemsOBSqO3kY1VjNsXKzXL6Sa7m4U JgmpCjAnehybPVziW2LTQ4U3O/+JRDQgYPD8JNyqejbcsqTpYMinGY5ek4ZAA5YjLdwu bh+sAYJz+OIAKRJVyC65DcYin05Eq8FVWjyVaNj31EAp/MGe8a63juzyR9skSwx9vr2y e1Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RLnPXe4J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc17si28964886plb.265.2018.11.24.07.36.16; Sat, 24 Nov 2018 07:36:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RLnPXe4J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbeKYCX5 (ORCPT + 99 others); Sat, 24 Nov 2018 21:23:57 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:43283 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbeKYCX5 (ORCPT ); Sat, 24 Nov 2018 21:23:57 -0500 Received: by mail-oi1-f193.google.com with SMTP id u18so12167300oie.10 for ; Sat, 24 Nov 2018 07:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/FuY6dgIuspQHr57QcxDIROVOnk4ZxSYqUTFxv9J2GE=; b=RLnPXe4JasnPuwQNW7n+lXR4QyKJ4P0OJXGm72UCGchI3wYQCzFxhMMO7upY96Kjcj nIciCaHW1OcawVqJf2JfcjNauX6w9crkRI9o/fUqtvh0Ne/wRfKELWRcL1UxVzTsDMD5 iTEBtfULUMdjH811F1KkV1Pq3bBKcIokv6byt48cEAyRKcdDQDtwd1WyGmG8Gj8Z4069 Comi1429HuqdyV2PgEcTnDsWJHaXN+QkXgCkbwNyZ6INj6diOcD/H11IVd7AdCf9vzyL UFmKBOBHR4vaRYH745eouPC0P9DJOYmMgCs/OZYeRo7mZ/sv9FAcXmTB9cb14oted8y7 /Z9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/FuY6dgIuspQHr57QcxDIROVOnk4ZxSYqUTFxv9J2GE=; b=SBaZ6yv2Cu5Vnild3JoiEyYLXyWwzn2dDR3le3qv3A8uA5HJ54Yr9wSgjyju8eBzUG VyZ89PVZx21iVBQYyo17YQsz1dg2iWngIRzI1+t6Qi1JUFed4QgvvVZVPXtwSGF0MJB3 rEpOxbWWtlTgOV3ofkqh46wKd2Rvi+PTx7+AFuDjZ9G8N1q7VPru3kE5mF+4gkBp2jw1 KDyRXT4l7BLR8BihO46hkxXIFhiqbfgSeBBLU4qsIZvZQLlc5pe45rtzsXIvC3KaG8Tn 3V9T6OtOmdo0VxBeFAEusBdsDkhjLlBgjsUrmGcDB8DxyCqouMZTCcsajYmJAGJ2v3aB J7ag== X-Gm-Message-State: AGRZ1gIeTAUr0YIPN0UHRDsmTltCho8MVOKXuy2zq0LmBCLfM6iohQOP kybllSjQWdUrKZxq6isGa4MW6h6FAQc9vUbK1WoyKs5j3l0= X-Received: by 2002:aca:d509:: with SMTP id m9mr10583311oig.82.1543073716617; Sat, 24 Nov 2018 07:35:16 -0800 (PST) MIME-Version: 1.0 From: David CARLIER Date: Sat, 24 Nov 2018 15:35:05 +0000 Message-ID: Subject: [PATCH] Little memset_explicit optimisation To: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, aryabinin@virtuozzo.com, gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Subject: [PATCH] memzero_explicit, optimisation for size. Using the return value of memset for save/load sake. Signed-off-by: David Carlier --- lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 38e4ca08e757..92da04a0213b 100644 --- a/lib/string.c +++ b/lib/string.c @@ -720,7 +720,7 @@ EXPORT_SYMBOL(memset); */ void memzero_explicit(void *s, size_t count) { - memset(s, 0, count); + s = memset(s, 0, count); barrier_data(s); } EXPORT_SYMBOL(memzero_explicit); -- 2.19.1