From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97BF943EF1; Wed, 24 Apr 2024 05:45:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F24A402AB; Wed, 24 Apr 2024 05:45:55 +0200 (CEST) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by mails.dpdk.org (Postfix) with ESMTP id 4A0F4400D7 for ; Wed, 24 Apr 2024 05:45:53 +0200 (CEST) Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c74b27179dso2568367b6e.1 for ; Tue, 23 Apr 2024 20:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713930352; x=1714535152; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=it+rKWoNtAjd0sTFydnvrCchR6lUtN+tVKLFi3+XC6o=; b=jigXKhNVilfPPgPnde2vZJoOH6tWBgjXN0xVNLBIg8sldg8Zuo0shn/S1FDDmX4TwB UtJYDDBeG/a+DdxzdSD8oQUR6rrrcCKcys/BmaRzam//wtjp2PQuUDXxLmr5hbpsaQj3 SDEChwHtMcTp2JgYH1+NEbkxVdp3lDlVL5lcLqiHJ6xGr/zeObtx+8Wy8N0yK3iQfhs2 NxAGVnvgHy6pcJ9j4AcygXU63ZluYJk/VzGGI1N73F8wW/TIyIB0fxlTfZn3i4U0seB7 YK6+ucMvBf/kAc2ZZIo3fzzjLw3erzm6KDa7c7/54oxY9peBOczsiBYbnODEDuQH8ej3 aq1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713930352; x=1714535152; 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=it+rKWoNtAjd0sTFydnvrCchR6lUtN+tVKLFi3+XC6o=; b=khr7x2zR4mjixAgbevTTi9w1C1j8o6L6OoeifPJzhFsyQsEyMRjIQe9rSAG7W1t546 l0kBXFVzmf2mh+gQSNeLim1frxK4amoHEPxx+KZigEPNQkSl8znp+7hVCIFfX3LCXvcw s8XqUrFY16TxJt5YPUh97s9Fn2L5gdujOR0WKMAG6CraqBWgaaAqh7H6GmNxgLlz66u9 Z8EcCrljTRg6LaPF3HnA4BdEThvcHkVVZ01NMWT6kQiMG+zrYCB6VlFNb12/huxWXZOW f1g3V3MQzAKUICmzo10wRxAsWIaqflsESM8QW6TmnFq+hslqX7zyIXDVgD5INM8mlQm1 9E3g== X-Gm-Message-State: AOJu0Yx8xsFxOk7A+yS30V4RspTT/EN+PX80wOIsZmj8ORHS9ruRfp1+ /nXWMZAHK2BWUEjWYh5ZCCQIRpn8Nklb334okVPVN6a5Fvq9uX074oUR0639UlKtiN1Zv0yccQu I X-Google-Smtp-Source: AGHT+IHq8CgeiCg6hi+0g0jZytzIIk+RJhwy3l2Iac1ZSBNh4iNt14SHtzmQb4GkTXzqrrLcO8gxxA== X-Received: by 2002:a05:6808:1526:b0:3c6:faf3:5ca4 with SMTP id u38-20020a056808152600b003c6faf35ca4mr1443002oiw.15.1713930352222; Tue, 23 Apr 2024 20:45:52 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id ei16-20020a056a0080d000b006ed06c4074bsm10410761pfb.85.2024.04.23.20.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 20:45:51 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: bruce.richardson@intel.com, Stephen Hemminger , Harry van Haaren , Jerin Jacob Subject: [PATCH] event: fix warning from useless snprintf Date: Tue, 23 Apr 2024 20:45:40 -0700 Message-ID: <20240424034541.134335-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org With Gcc-14, this warning is generated: ../drivers/event/sw/sw_evdev.c:263:3: warning: 'snprintf' will always be truncated; specified size is 12, but format string expands to at least 13 [-Wformat-truncation] 263 | snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i); | ^ Yet the whole printf to the buf is unnecessary. The type string argument has never been implemented, and should just be NULL. Removing the unnecessary snprintf, then means IQ_ROB_NAMESIZE can be removed. Fixes: 5ffb2f142d95 ("event/sw: support event queues") Signed-off-by: Stephen Hemminger --- drivers/event/sw/iq_chunk.h | 2 -- drivers/event/sw/sw_evdev.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/event/sw/iq_chunk.h b/drivers/event/sw/iq_chunk.h index 7a7a8782e6..e638142dbc 100644 --- a/drivers/event/sw/iq_chunk.h +++ b/drivers/event/sw/iq_chunk.h @@ -9,8 +9,6 @@ #include #include -#define IQ_ROB_NAMESIZE 12 - struct __rte_cache_aligned sw_queue_chunk { struct rte_event events[SW_EVS_PER_Q_CHUNK]; struct sw_queue_chunk *next; diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 1c01b069fe..19a52afc7d 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -228,9 +228,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type, const struct rte_event_queue_conf *queue_conf) { unsigned int i; - int dev_id = sw->data->dev_id; int socket_id = sw->data->socket_id; - char buf[IQ_ROB_NAMESIZE]; struct sw_qid *qid = &sw->qids[idx]; /* Initialize the FID structures to no pinning (-1), and zero packets */ @@ -260,8 +258,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type, goto cleanup; } - snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i); - qid->reorder_buffer = rte_zmalloc_socket(buf, + qid->reorder_buffer = rte_zmalloc_socket(NULL, window_size * sizeof(qid->reorder_buffer[0]), 0, socket_id); if (!qid->reorder_buffer) { -- 2.43.0