Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp960332rdg; Fri, 13 Oct 2023 06:28:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOkykHLE88FFaNYUPrDTT1gdJGDl43CzbrCDSaPSci9jsG5kaLitLX0Sz83tkCuw1GUCRm X-Received: by 2002:a05:6a21:62a:b0:164:e94b:d3ae with SMTP id ll42-20020a056a21062a00b00164e94bd3aemr23783851pzb.54.1697203737399; Fri, 13 Oct 2023 06:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697203737; cv=none; d=google.com; s=arc-20160816; b=vCvn79bRhYnL141CSAIKjvIVeNnVbH15QLLf1nYUs2YJAumaeA9dSK6ggfVND9/+fL 4FDW7YPOzUzkoRYm6cSA+inpy21e5LL1koZ+9O8jqFyZiloL8C7cvE7UprBOhiWbgOy2 WKzmXy01/5yupW3sDKGR9wg/HqwTuIuuxRuar+1J33gXnw5tADpZkHICglIaU/9edqFX W9LvRA8CBFdgfgMDGzx5x4H1+y0VtkIYFCmVm+3B6nlcvgWOrqXhUKa6+DLS84cPiw1F 9qtbDKtLKVHRJAUeB//wNAyPRdq+3pIkdHO5PHzkRwaGmhcIGwaOSnas+4JvqJSTY1XR UOZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nu1H4LZBKYsS6+OEzpbpZBdBf+RzObohI0qR4WVPoqc=; fh=LvcHoJDC2xuqquYY30Xh1v5VNzPUAYhejIOdBl09rR4=; b=E12lMksawxpqWkpV20xPC3OOf4Wk/rFmAjTw0AcJIlyQBBlmHVWc3wYKZP48bGe8Uf L0AUP8Af8llh/idcNqUS0x3d67gE68iJlQyKDlT/I56piMOWgymlV4ZpPFJ8tBLaNSel Sjj9LWubkwYV8VoFOq1YLrWebNBBLUCJV19gZX0lHvEHTyBx0wS3nb/rRAEwBfVMk/GZ LxNw4nmo7TSD4IpJIsKqTJm4YRLxs0nGpkZ7W/XDlzRw0ieHAicaW9rErynht005D47g Qea1MX8xZ3y4JeHnmQp0VIw3r3vkqHVfNUZgAgZcYkMoR6gWsElmIq+3/E0tyugulMRE t0CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FXOtomZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bw10-20020a056a02048a00b00573f703a239si5250415pgb.414.2023.10.13.06.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 06:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FXOtomZy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0F1258026974; Fri, 13 Oct 2023 06:28:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231840AbjJMN2n (ORCPT + 99 others); Fri, 13 Oct 2023 09:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjJMN2m (ORCPT ); Fri, 13 Oct 2023 09:28:42 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9755CC0 for ; Fri, 13 Oct 2023 06:28:40 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-27d153c7f00so1522719a91.3 for ; Fri, 13 Oct 2023 06:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697203720; x=1697808520; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nu1H4LZBKYsS6+OEzpbpZBdBf+RzObohI0qR4WVPoqc=; b=FXOtomZy9YwNlo4HJoG+HhwuUU5t9aDSQz6bMJ8T0WIMYgskhLzgDOjuH3/HFWJHPw GOXVciOEUtGHFQo26XItQAVC4DT3RG4/dndmH3epA44UdQAfzDD/E8PbKTQblr4YQak8 KQ5hxuqxUaRXaIYA9KM10x79wCNMfeoAdiQcqR24GVvdF5y1jp7gYDrNsQGh3lgATD6J l8NximvSp5XfH7g9WFG5sVnpy/vL5kTnw6GSZsQiLxiNdlQ1m4AO4LxUHL+oiyXDy9WH aZBslZNuOZQ+gx17nwkL1tOhNWeS7ljWyZjlQndP1CiUVmEMunBp9InDVFLRQrnRRiJu 9YEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697203720; x=1697808520; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nu1H4LZBKYsS6+OEzpbpZBdBf+RzObohI0qR4WVPoqc=; b=sXa6ebiF9bSzBXLQaOZt4qySmaFh42hrt5JmYCQW1cE1U6Sgzy+pNBenIfn2WKF3pU ebzK9eY7jl78qwYulobTB+BUlNJhQug2zrpjBGTmU9GDfdfTe0de93ypCLOvdbkYHJR/ ZloXbtjLoxhURBUsiocjTF33DQtREjYXfwfZDFJKqRDJyVx+sus+2fiL5siCZt0AQrEj Lz3JIhHtTfyyh+Zn/qjZAoDtHCZ2ZPGwzZyy7JtrC+eUEXAkpOPOU8QaOgavWNEapEEw lgpZkjIJESbV5KPGNqlC3Hz+xqsYSpYVh2FxWUxlziM/FMRVLOlJrpHvadg44UwnzR44 nfKg== X-Gm-Message-State: AOJu0YzEGc8JygtPt9jsqNzzElSrdVNb6OpPiyb9sNJxTLW6EE4cx1ba 4oAm4Sqpm0QiIMwu4icJrcI= X-Received: by 2002:a17:90a:b00a:b0:268:3b8b:140d with SMTP id x10-20020a17090ab00a00b002683b8b140dmr21495491pjq.35.1697203719841; Fri, 13 Oct 2023 06:28:39 -0700 (PDT) Received: from [192.168.0.106] ([103.131.18.64]) by smtp.gmail.com with ESMTPSA id 29-20020a17090a1a5d00b0027d0de51454sm94071pjl.19.2023.10.13.06.28.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Oct 2023 06:28:39 -0700 (PDT) Message-ID: <05a668db-118c-4568-b2cf-49febb04a6d2@gmail.com> Date: Fri, 13 Oct 2023 20:28:30 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6] staging: wlan-ng: replace strncpy() with strscpy() To: Dan Carpenter , Calvince Otieno Cc: outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Luke Koch , Simon Horman , linux-staging@lists.linux.dev References: Content-Language: en-US From: Bagas Sanjaya In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 13 Oct 2023 06:28:55 -0700 (PDT) On 13/10/2023 18:19, Dan Carpenter wrote: > On Fri, Oct 13, 2023 at 02:15:43PM +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 >> --- > > It's still white space damaged and can't apply. :/ Try save the email > and do `cat raw_email.txt | patch -p1`. > And better yet, use git-send-email(1) to send patches. But don't rush, as you have sent five versions of this patch today. Please wait for a day to a week and then reroll. Thanks. -- An old man doll... just what I always wanted! - Clara