Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4565525rwi; Sat, 22 Oct 2022 12:11:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61bIYzQ3v2i6jJr1Qi85f1Jxuy+y2kK2rmDLX80GYSxtxINOQz8EHxcID1/811Z5UBoGlj X-Received: by 2002:a65:6041:0:b0:449:8b9c:8d29 with SMTP id a1-20020a656041000000b004498b9c8d29mr20968808pgp.335.1666465871596; Sat, 22 Oct 2022 12:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666465871; cv=none; d=google.com; s=arc-20160816; b=HbAhS+eNmuOsh0MOsTjh2EKZO8A5HK25eZz6Sq2ucaUXFQN3L2r3lYnWcRIjgz4uwQ 01r0qduZl7W5K/uQAMNYbOeJsCb9TdX4mXInE2PJFDbMuNmcViqffi9WMTXBAS4huJ+X xFnpivyMTxl4USs2rW1jcL9WJM31vemD0IY/KR7718fgZG/U7qwCfiHjY68mk40iNIPB GihEk4PfL4ZIcO38Qzp1tE1vgBfSMu23WG4ynMavejDwZbd0uPx1eInv5QlMpWUf7Dop Q+yLqzotuTXHUKZ/jd025lKwMwB2RBaBBccgkV0C5Zj1c0pFbPJbLXnXd1qLnIaLaqrE lOmg== 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=kA1RUYYc/4X5sRFnjwWDavrb0+igVW51vZRNo+KLENo=; b=K4k8Uyrnh5jK5T8Pdr/oOdwpmBa0SnZ7MAy2ryBtpjjjd1NfMllzIs6Li4wZW++9/v 5wFrYbiLeQlLPA/fM+hyGmnkANFRNIt2TOzpKJ1Gc0KzX8LjHZBktE6Yz287JA8tiUaS aYoBCKML1ceTq+Xn846RfjDgoX6rgWMH0H4Zwp2hG0W/knrKm1XNCeLIDG+dkWZopFA2 Z/+qiJ74x1nvTth032qyIJR/cJRTXz4TEYUTTeHSGI6eGuyzHLOy0WeQMNI3JGlteHtm Rz2UYjfuNhSk0DsAL0qRooiUthUBRobs01BmB06WWWoJILVBEssM/drA09nmq3sl2nU1 GeZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pk1JPaO1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a17090a9a8600b001fd6e58cd98si3144098pjp.123.2022.10.22.12.10.44; Sat, 22 Oct 2022 12:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pk1JPaO1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbiJVRsU (ORCPT + 99 others); Sat, 22 Oct 2022 13:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiJVRsR (ORCPT ); Sat, 22 Oct 2022 13:48:17 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183AAB2 for ; Sat, 22 Oct 2022 10:48:17 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id q19so17010207edd.10 for ; Sat, 22 Oct 2022 10:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kA1RUYYc/4X5sRFnjwWDavrb0+igVW51vZRNo+KLENo=; b=pk1JPaO124kD9FUXsMNgIuLUnQeM7DtqHs1KwuFroXIGt6EGsnRBXLTXcE0liY6YNM QR9Z3txWC80+cz19T4MJOkXDvE2bf8gO4lrGGFyaq4hPGBH3/ZA4Hj6mNzhuvdnaEAea dtcwslJnx/X2Fl80CsqK1QTxyCuGNyA3KmtpcMeXJhpDADzfdLIj1scB6BS9ixy4uQKj jIQxALXTWuEBXMZloxPF861qOIXYfsdtiJbJF9ipavXB/43RBhmxXatbjtONQEXEgRgG W0Z6i7wt7n+9KtVHRCfuqUrjxY2+gxsWUWE5BgwueYwNvGUZEnGO05kr+8ao873HagD2 8lPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kA1RUYYc/4X5sRFnjwWDavrb0+igVW51vZRNo+KLENo=; b=hL/26eqRjkZ4aj6GsSwRrWE4XYxfvbcm5DySo/r0ztpxJ1cyul3ZNqIs02HqKxnDYF 0Xcen95shEuOTbYBw8pSpG2xvdYUteggEiXFcQXkLXB7xvr6+WEihkSojcmh8AtaFBXz XaZwBsEmoTMNsiJHWEcfh4zPrnXaaYTNlt2K5ZXn5upiKHUTDu2eXRMqqXURWeSH1AfW 2/yg1f4v8C1zkU4HCLENVH92AqUkS7N0JZpARLUnNb5zuNGWdO3bvJ0QkYiAqd8angBe RagWYhRXk03cCTzF1sytyTqrUJsOkvejpXRfkgQ87UbjZZv9VCSLOyXrDIwn199shueq rGHw== X-Gm-Message-State: ACrzQf0oE9t4OJmuXLjJehN9uZpGezcpeFtSiH0mqeMuNVA29iE1aUX6 8wqt1qbnnOv57Uvy2o+IvLE= X-Received: by 2002:a05:6402:520f:b0:45f:b7a0:a31 with SMTP id s15-20020a056402520f00b0045fb7a00a31mr15742960edd.379.1666460895540; Sat, 22 Oct 2022 10:48:15 -0700 (PDT) Received: from localhost.localdomain (ip-217-105-46-178.ip.prioritytelecom.net. [217.105.46.178]) by smtp.gmail.com with ESMTPSA id r17-20020a170906351100b0078d4962a46bsm13054235eja.190.2022.10.22.10.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 10:48:15 -0700 (PDT) From: Nam Cao To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: namcaov@gmail.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme-tcp: replace sg_init_marker() with sg_init_table() Date: Sat, 22 Oct 2022 19:46:36 +0200 Message-Id: <20221022174635.15643-1-namcaov@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In nvme_tcp_ddgst_update(), sg_init_marker() is called with an uninitialized scatterlist. This is probably fine, but gcc complains: CC [M] drivers/nvme/host/tcp.o In file included from ./include/linux/dma-mapping.h:10, from ./include/linux/skbuff.h:31, from ./include/net/net_namespace.h:43, from ./include/linux/netdevice.h:38, from ./include/net/sock.h:46, from drivers/nvme/host/tcp.c:12: In function ‘sg_mark_end’, inlined from ‘sg_init_marker’ at ./include/linux/scatterlist.h:356:2, inlined from ‘nvme_tcp_ddgst_update’ at drivers/nvme/host/tcp.c:390:2: ./include/linux/scatterlist.h:234:11: error: ‘sg.page_link’ is used uninitialized [-Werror=uninitialized] 234 | sg->page_link |= SG_END; | ~~^~~~~~~~~~~ drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’: drivers/nvme/host/tcp.c:388:28: note: ‘sg’ declared here 388 | struct scatterlist sg; | ^~ cc1: all warnings being treated as errors Use sg_init_table() instead, which basically memset the scatterlist to zero first before calling sg_init_marker(). Signed-off-by: Nam Cao --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 1eed0fc26b3a..dc2def86076d 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -387,7 +387,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash, { struct scatterlist sg; - sg_init_marker(&sg, 1); + sg_init_table(&sg, 1); sg_set_page(&sg, page, len, off); ahash_request_set_crypt(hash, &sg, NULL, len); crypto_ahash_update(hash); -- 2.25.1