Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3333032imu; Sun, 11 Nov 2018 12:34:49 -0800 (PST) X-Google-Smtp-Source: AJdET5crRmhyPxEqvniUTANdZxTJAYCy9ZwJa7mfA4cHYiceUNFPdVYa8tAQGpOOTaY3Oi5hdmsa X-Received: by 2002:a17:902:a9cb:: with SMTP id b11-v6mr17180810plr.219.1541968489158; Sun, 11 Nov 2018 12:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968489; cv=none; d=google.com; s=arc-20160816; b=WhpJhbJzykpYIB72SsGwmqhDdvkqzSQCWolSH+sCsWskAPIlS7uXqRvmnFKHkesNe4 ZUTrVDmtLMht8/LquXBiwlY4TduVwz7+kWsENXvcG0UypcE6MGpaG7zjOw4d9+u4V6wT KuuIDUzyXyiR/qBNEV4IIN3Q1hMOKHZyGFNqPY17RyJfsMMZZD3A1bW+kXeVrSD/ITqV 4mZ72dmgOCiGrsF4e4XKlwMs4z/FIuDwbrNxj2eDEucCeAMdzX7XmEHvwfRESWs+mXyM KfYWijQu85wn0YvCZ/pkM3eXCXTq0dlJT5kKuPpZvQ/x41s/DbUfKKLcN6x09X+HdqSQ qcbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=xrMFBCBwwkVSagnnmX2O4vPgGSnGJGQVdnDxNVFTrVA=; b=epMuWP549242VdgLZGJi1nTS23oLWtpFcdR5cAmKuHQMiwwMW6euLuQSBS8XSaP3+r jHHEe+y+pIpiMbELE/8JqQHvcLVhRUIuwjIb4jVEnbrDjcIL7Wkpk3IF24ezBdbzLVU6 iZxf1uYa43Moz9Dv7lZhhhFYdLCM+UVIMb4j4LTfYbIUFcpthjEzITTj6DBsvoYOfxny OE3bo1HbxmAJRL9T0TVB7QzsRrVmWUSmJOlzKi8duEYs1JOL0z/k3lDFsA++eji4dlsv MIr5CxmUqmm+B8FqHCQCTy3KlTptZWOKO7bzZcjnNsZad48ol67Myu6n9qXRsz4vFDVJ 20jw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2-v6si15089695ply.21.2018.11.11.12.34.34; Sun, 11 Nov 2018 12:34:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730269AbeKLFsQ (ORCPT + 99 others); Mon, 12 Nov 2018 00:48:16 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49884 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730175AbeKLFsN (ORCPT ); Mon, 12 Nov 2018 00:48:13 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsZ-0000oO-45; Sun, 11 Nov 2018 19:58:43 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsW-0001jN-K2; Sun, 11 Nov 2018 19:58:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Tejun Heo" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 255/366] string: drop __must_check from strscpy() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Ben Hutchings This was done as part of commit 08a77676f9c5 upstream, from which the following description is taken: > strlcpy() is worse than strlcpy() because it unconditionally runs > strlen() on the source string, and the only reason we switched to > strlcpy() here was because it was lacking __must_check, which doesn't > reflect any material differences between the two function. It's just > that someone added __must_check to strscpy() and not to strlcpy(). > > These basic string copy operations are used in variety of ways, and > one of not-so-uncommon use cases is safely handling truncated copies, > where the caller naturally doesn't care about the return value. The > __must_check doesn't match the actual use cases and forces users to > opt for inferior variants which lack __must_check by happenstance or > spread ugly (void) casts. Cc: Tejun Heo Signed-off-by: Ben Hutchings --- --- a/include/linux/string.h +++ b/include/linux/string.h @@ -26,7 +26,7 @@ extern char * strncpy(char *,const char size_t strlcpy(char *, const char *, size_t); #endif #ifndef __HAVE_ARCH_STRSCPY -ssize_t __must_check strscpy(char *, const char *, size_t); +ssize_t strscpy(char *, const char *, size_t); #endif #ifndef __HAVE_ARCH_STRCAT extern char * strcat(char *, const char *);