Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp866408rdg; Fri, 13 Oct 2023 03:46:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJTP530t++3eHDKOr1dxP1+LTcNfirkbsSUQGTAogqu3OsGHgj1ak4doKM3jyyrbzumoGW X-Received: by 2002:a05:6358:2611:b0:12f:158e:ed88 with SMTP id l17-20020a056358261100b0012f158eed88mr30848122rwc.22.1697193974850; Fri, 13 Oct 2023 03:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697193974; cv=none; d=google.com; s=arc-20160816; b=UAg+q/T/Aatqd3LxenEqDkEL7LnNiwX5pxg9rv4e3VcX71ScbW8IImxT3B4DXKbgfM CcjEW4mgTARn3bstQYp/utx4PIdEbWKgkhqPiPF9GuitGiY3UwbPTY+AevYIBAWWGz8d n/9uZXb/gcHXdWvUIrKQDghoAzCMy1kEssoYNHBXSX8jtXU0R9zESXxoCzkVGaJGMvOs TE91jjs7lIUqmUoyQ1qMn6HGgtv26HZZCE8jaZvM2A2h9WA2E8LYNTSvprDgUrv03Y9K k5aH2RPAMjikBAcXaJrWTnBbAkyhy9eJX4lkRg6FOzObgKWv7nT3hWXBh1FfJyNpu8D0 lNWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XCTYo1QvPgr9D8OOo/ac1BFS2ndiObZ+hWV0ZomsWcE=; fh=cOckVxVjrM5jmf86/i5eTTw5wBLyeTzAmcCgKIUtB0I=; b=vitHh+Vp507lXlX9OoMZDUmmcrKzuqsBXKjTb8u6lEKiTi3D6OPkG5e0B9AUHldoDw 0++Bh1QiG7CiSEfRdJIQBouSvnKrdtLJkvhc6KZGt8s6xLvXMGILMynsfMUUhypEUlxy lE9kLyegEHu5V0JMTbjnuSbKdAKiq/Rag0n3Xu1N4hIsVFwYXpX3hUHDHGhSh90BJ6oQ ndbkfI0PJ5MVzxLZzOWSDi7u+DmfhvvP5WZBNvGcfHFPJFcwsObFLr3lTCN9ObyMO7bt 2jk1+EP6fcdktCgIYzvpFs45/quOifXa/+2Cbbw0QXX+I6ipfoqmZ2vs/GssVGdOhFGc 4eqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bHpiG4bO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k198-20020a633dcf000000b00578fc70f905si4182024pga.315.2023.10.13.03.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 03:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bHpiG4bO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8250080765E6; Fri, 13 Oct 2023 03:45:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbjJMKo4 (ORCPT + 99 others); Fri, 13 Oct 2023 06:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjJMKot (ORCPT ); Fri, 13 Oct 2023 06:44:49 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92169DC for ; Fri, 13 Oct 2023 03:44:47 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so22605805e9.0 for ; Fri, 13 Oct 2023 03:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697193886; x=1697798686; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XCTYo1QvPgr9D8OOo/ac1BFS2ndiObZ+hWV0ZomsWcE=; b=bHpiG4bO2gHO8vH+gmWGl/tmYq/eDxm+8xKcwPQP6qTw9NsGwmZx4+56V5emKsY4zL PXMO29OCJzFzTvNbsNIOn7uCEFHjVUukrra9CNfv2OAiAayyJcWNddhInWbvrXQr+550 mFnrrDAYVF0gwxYsg2T4VONsDxIINvDZom3XjIjY+kaXuo7niKywfEvWAkh6+NADX3Jh npsMHq61FYCCEoqKLnVmFdbXkcyMprFdF8KRqcEKsh4ETNTWwHU6v0912K2Y5nS1w8RE al5GYdEdv1VSv4razMkTwDrDtrblJb5dFgWjYOgCkv6K/Zw9HJq5w6VAfp9Vxawgd5h2 lW7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697193886; x=1697798686; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XCTYo1QvPgr9D8OOo/ac1BFS2ndiObZ+hWV0ZomsWcE=; b=BU+BUrjr7+G32wEDhmjfe//podC/0bTY1EvAcwtaHhVQcc9/FFnjzbenqA6M0DzOg9 y9kfmGR5K7Z7Pd8S8J5bdn5rtbKWLpbEARSqNO7E43kfybiAu+D6kHJyklvD+nUizMiV cLUEGVKwow+t/n8+lIKnTNIcgwmwJeTSl80SZXGOxxscVI5/QAcmgj0pVs5socgrFv4g 6+L6Lg/Pd2iD8abqWGGhiapL6wMqxXTzY3DyZ7qF44OyXU+ZKFbnPTWQ27gYIRzv1Y8X Y5hT8P5doFpC9aKjtgM2xMYUuAktj6n2KoGbgiemIf+1MAJA9qcO5BIHsWpWFN2O3lng XqgA== X-Gm-Message-State: AOJu0Yw3l+6RAixgJs0hOlZdXM9UZBmzeCPOaFG8fQeLTzSw1mze0bwv V94ozlM/hT6LA702b/TEcSc7iYuwyMzRfqvWRcI= X-Received: by 2002:adf:eec5:0:b0:319:7134:a3cf with SMTP id a5-20020adfeec5000000b003197134a3cfmr23692272wrp.31.1697193885917; Fri, 13 Oct 2023 03:44:45 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id e2-20020adfe382000000b00327de0173f6sm20515196wrm.115.2023.10.13.03.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 03:44:45 -0700 (PDT) Date: Fri, 13 Oct 2023 13:44:42 +0300 From: Dan Carpenter To: Calvince Otieno Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Luke Koch , Bagas Sanjaya , Simon Horman , linux-staging@lists.linux.dev Subject: Re: [PATCH v5] staging: wlan-ng: replace strncpy() with strscpy() Message-ID: <4679268f-63ca-4854-808a-5cb45624167b@kadam.mountain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 03:45:18 -0700 (PDT) On Fri, Oct 13, 2023 at 01:21:21PM +0300, Calvince Otieno wrote: > Checkpatch suggests the use of strscpy() instead of strncpy(). > The advantages are that it always adds a NUL terminator and it prevents > a read overflow if the src string is not properly terminated. One > potential disadvantage is that it doesn't zero pad the string like > strncpy() does. > > In this code, strscpy() and strncpy() are equivalent and it does not > affect runtime behavior. The string is zeroed on the line before > using memset(). The resulting string was always NUL terminated and > PRISM2_USB_FWFILE is string literal "prism2_ru.fw" so it's NUL > terminated. > > However, even though using strscpy() does not fix any bugs, it's > still nicer and makes checkpatch happy. > > Signed-off-by: Calvince Otieno > --- > Patch version v5: > Removed v1 patch details from the revsion history This patch doesn't apply correctly. It has been white space damaged for some reason. Tabs replaced with spaces. Read Documentation/process/email-clients.rst. Hopefully the first paragraph convinces you to just use git to send patchs and you can skip the rest of the document. I try to catch these sorts of mistakes earlier instead of making you send a v6 but I thought the issue was the v1. Sorry about that. The good news is that now you can delete the extra space character Julia mentioned. regards, dan carpenter