Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2376019rdb; Tue, 3 Oct 2023 21:40:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgz0soncRXaMD9K/2QkQP8I82FQSEnqy0N2qzXexjPMxRGNbZHqBRAuJljXkGBK9LcDaRr X-Received: by 2002:a05:6a00:1495:b0:68f:dfe2:9f03 with SMTP id v21-20020a056a00149500b0068fdfe29f03mr1583729pfu.11.1696394440328; Tue, 03 Oct 2023 21:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696394440; cv=none; d=google.com; s=arc-20160816; b=aiq2v3wf5keOPKLI+6c+LOV899tHbe2qqYK3Ah2c/KiUadMBrpbzm3Y45L5Y46i5wP djP89s6PQQZYxTSD6R0ddH+X42gH8dkHByDJocUYzx+Lx9vsxZCfGCQw6A1G2TRkAQEM Tv2RkSIrSqLF8+Vqb7Ova7E3+yGDWG843PFZCkJttE42pReKEwpJIxOO/eO6iUJnsrla JmLXAlyh4KU/6ilxDeLkdtcLfS7sPuRra6RA5kex2fAx2PrVdr1nsrKrqNcLvW/x/Bfw VxOUQwBHnTYZHTTwjpCA4SbAlXnutnQvAJzDColbiyPQDK3zyiMvcxZZiH+iZ9PJ81Fs ITqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/crcVPn1Jhlshr/NTPd48q9zyU3B6RW2LIG2ZLiJMi0=; fh=4WhjvLREGUHjE31q2Sp9ZegfkBKYt1oT+1qP4qSyC8Y=; b=xUrxGifDrRD1V+YvzzGPwtKmlls/HSdJWOff79J3eYbUU1hkr8tTyJEn88EANKOHNh wTdRQaiezYdz8nrJbs2wOECuv4sxDfo/dd75O84roENvNvUEp2V68EfX3GIjwLC5jcVu cy3szhW293lFhBpFuuMQ+0uTABu4VoNSyW5YMsFRnsFgx02rpMCYlDF5tnWpjzKHJG28 /Pj5Tq9usRJk67CZBdSCkMHPXg9Q8/4CV9G50yCwEQiy27pxlSCvMYDQfG9RJB8x0T9x kcBzrkyn8JVlzqMwgWtoW8pKYCpBDi32jaaDuVjUR1wDz/oct872DZjQ9kgH/uJWJSCe joCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B1bZ0SUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id eg20-20020a056a00801400b00690d9cd7b62si2847186pfb.123.2023.10.03.21.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 21:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B1bZ0SUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0A450819D23E; Tue, 3 Oct 2023 21:40:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240577AbjJDEkc (ORCPT + 99 others); Wed, 4 Oct 2023 00:40:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbjJDEkb (ORCPT ); Wed, 4 Oct 2023 00:40:31 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9168590; Tue, 3 Oct 2023 21:40:28 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1e12f41e496so1114360fac.3; Tue, 03 Oct 2023 21:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696394428; x=1696999228; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/crcVPn1Jhlshr/NTPd48q9zyU3B6RW2LIG2ZLiJMi0=; b=B1bZ0SUfG60nes5JWYr4EgrL18n1NWmqx9eaN1FnuH7dUNAluQ5xsHpKT22Kc74Oc4 4WMWlfkfHgGgOkYqwQzaFl97dKbqdILzLte4bdgYW977Y1xLXQbl0o94PZO9e5vPq2kz LlvuZS12I17h/6XQIgZBkDnx970PG9sG0uM7BMOan3egtqvpBZdx75r2kW+/GvRjfngL OdMPoor76FnGDdDpRkHs56ZO9T5hMdGjncN/W1JHdgIcm8xITlYb2QfDeOVmkxhSFA6q PBOJ5ou2HXbBg+OJY55hMKHs5G+vv3WM2JOHRKqh8dsWVV93mk24WgFyboDPDEy86+9g PKag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696394428; x=1696999228; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/crcVPn1Jhlshr/NTPd48q9zyU3B6RW2LIG2ZLiJMi0=; b=tcRSMcSaoA0AHYEdDB6ScWMhPicaDODNlxPOiPCfjENAVzi5w54IMzaSQd/5z9UDzc LfO+QQ5MvR4XkIj2jISnOJa53QCkNdT+sCjOWxb/XmwWrncSLNLbwaxKrJGpuhs58rYc wR37HX7s062olzbzgbqtiCC2fYwWayNss5VE0t+QztKhTPSqh1bT6lXTA9VOxCNr2HUI inLrIB0U7240L8OIN7aYWBF4MpXuSzdGAMdv26xFszEcXf+Lcd/g6j8geXdVapu+J+A+ KOeBoPCOXqwPFqEBB388iCPhwKXEfKLJirxcGe4kdKCNuuSJYXjH9+G6J6TmPHiCa8aF ghpA== X-Gm-Message-State: AOJu0YypnP0swjyDs15x6AuraVL6mFjZ9pZrmRb+uU6ZEuAmPk/e2Lj3 8P4Qio4YMYAZ9uRpgp/kwkI= X-Received: by 2002:a05:6870:e611:b0:1d6:cbcd:80f8 with SMTP id q17-20020a056870e61100b001d6cbcd80f8mr1551179oag.54.1696394427622; Tue, 03 Oct 2023 21:40:27 -0700 (PDT) Received: from localhost ([2405:201:a40d:5ac2:680f:b470:5925:ab0f]) by smtp.gmail.com with UTF8SMTPSA id gu27-20020a056a004e5b00b0069348918cfcsm2213753pfb.193.2023.10.03.21.40.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 21:40:27 -0700 (PDT) From: Shubh To: Andy Gross Cc: Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Shubh Subject: [PATCH] soc: qcom: cmd-db: refactor deprecated strncpy Date: Wed, 4 Oct 2023 10:10:17 +0530 Message-ID: <20231004044017.37027-1-shubhisroking@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 21:40:38 -0700 (PDT) Prefer `strscpy_pad` to `strncpy`. Signed-off-by: Shubh --- drivers/soc/qcom/cmd-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index 34c40368d..dc42704d7 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -152,7 +152,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh, * query string is not necessarily '\0' terminated if it bumps up * against the max size. That's OK and expected. */ - strncpy(query, id, sizeof(query)); + strscpy_pad(query, id, sizeof(query)); for (i = 0; i < MAX_SLV_ID; i++) { rsc_hdr = &cmd_db_header->header[i]; -- 2.42.0