Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8087066ybi; Tue, 9 Jul 2019 08:59:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPhQD4C50XOmlylWPIAT9AAnlcaWb4681qO9QpzpJCehFzg2seXtvcM1eV/delHqq+LnFa X-Received: by 2002:a65:5845:: with SMTP id s5mr30836459pgr.432.1562687998717; Tue, 09 Jul 2019 08:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562687998; cv=none; d=google.com; s=arc-20160816; b=vg15nYCy0dO38ZrpuRjxBV2o8PvEr/hLd+Kbd6aQtYeoBX2OnSbCumSp3LJ1TaWv23 harF+jaQl4g1VoGbw1q0LB5IiD+HNJZ0dJHfI1vMQe86K9ICLMIXOzeQFksDxp+jpZGb miHnbR4FexG6z3chkqXVCFhbgewwpdeFFKMvDBdlNGTRbDdNMRk0XiFwaFlt1lDWYHBO 0ek6qcnl4RIJ8EMkd8fWfQOfZr+leO3zJkLTPguQvs7Sz7I4I+TUooDrOGHhFZ1FYMb1 pt77BXNR3xfxlEOsHZHAiQedcT15UESA/WverMyIPe7JeUJXAnoWNPLiUllZwxx1QvM3 8+Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=QBm4n2ayQw6nPXVeuN4nn7o73UvF6ppwL9JZo261/XE=; b=uaOOcveqNrRd26ycffh47HivZimIF9gJz1UNVAkQx9MNeTAKnsAOzms+Xpwk6h8BiJ D1WXKWFCG0INH+nYZeYw+oXSypvw+sCubLLHFxso9gPI1TUxPSJtHByAUobBoJwf8HNi 40InwyODL0OyLakQYCnpYPt/FUvWnTaqjmyCLykWCw5JokOCr3VAoVrzoJ7joBg1H6ev HKAznpI6wjyQdPazb7NLvxSJbUjnLTJc5GiWuHlCvSkmtzt0QbDbyqFLZQ0RNSiHHxzG uhNQr5DpBbPlkVwK1b9y3ryqEQ50SxaZzNVDPeGKJ26dOt2sQksmAIW5DfqyExEBlw2E S0BA== 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 i64si22511418pge.307.2019.07.09.08.59.39; Tue, 09 Jul 2019 08:59:58 -0700 (PDT) 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 S1726374AbfGIP6K (ORCPT + 99 others); Tue, 9 Jul 2019 11:58:10 -0400 Received: from ms.lwn.net ([45.79.88.28]:58992 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGIP6J (ORCPT ); Tue, 9 Jul 2019 11:58:09 -0400 Received: from lwn.net (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id D47A0737; Tue, 9 Jul 2019 15:58:08 +0000 (UTC) Date: Tue, 9 Jul 2019 09:58:07 -0600 From: Jonathan Corbet To: NitinGote Cc: joe@perches.com, akpm@linux-foundation.org, apw@canonical.com, keescook@chromium.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] Added warnings in checkpatch.pl script to : Message-ID: <20190709095807.72adb380@lwn.net> In-Reply-To: <20190709154806.26363-1-nitin.r.gote@intel.com> References: <20190709154806.26363-1-nitin.r.gote@intel.com> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Jul 2019 21:18:06 +0530 NitinGote wrote: > From: Nitin Gote > > 1. Deprecate strcpy() in favor of strscpy(). > 2. Deprecate strlcpy() in favor of strscpy(). > 3. Deprecate strncpy() in favor of strscpy() or strscpy_pad(). > > Updated strncpy() section in Documentation/process/deprecated.rst > to cover strscpy_pad() case. > > Signed-off-by: Nitin Gote > --- > Change log: > v1->v2 > - For string related apis, created different %deprecated_string_api > and these will get emitted at CHECK Level using command line option > -f/--file to avoid bad patched from novice script users. > > v2->v3 > - Avoided use of $check in implementation. > - Incorporated trivial comments. > > v3->v4 > - Incorporated comment by removing "c:func:" But you ignored the comment asking for a proper subject line on the patch. Also, > -only NUL-terminated strings. The safe replacement is :c:func:`strscpy`. > -(Users of :c:func:`strscpy` still needing NUL-padding will need an > -explicit :c:func:`memset` added.) > +only NUL-terminated strings. In this case, the safe replacement is > +`strscpy()`. If, however, the destination buffer still needs NUL-padding, > +the safe replacement is `strscpy_pad()`. Please make those just strscpy(), not `strscpy()`. As I said, the right thing will happen. Thanks, jon