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 394B743EF8; Wed, 24 Apr 2024 19:12:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11098402D4; Wed, 24 Apr 2024 19:12:49 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mails.dpdk.org (Postfix) with ESMTP id 2B9E7402D1 for ; Wed, 24 Apr 2024 19:12:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713978767; x=1745514767; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=/eFmVQB1CcnkDEKWzK/ExGJEA8oozYACBX+Zg5kexo4=; b=lx8G+QudRg+MnCrSzG5gcvj5y3I2R3YfK0lzIXNav2nxslgra7odRIaD zI6hlIVWm1qZ11p9L/lffHkqMC4M2Dn9rb+Vd/OL+rFVo7bnh7goyKgsH gQ+trBM9vDfTATOHi4R+kRyOHOQxcop0As5ssR4K4U1qt5JLCIeFdzA+9 hLXK68PyxUMIpi9GAxJctA1qc1GE9vs+McrvAB7WgfIWM3CwN3iAJv9es 45feWLLQdRMeK/GTJL9SLG+zm35bwBkVA0tVScD8HWmlAfXUbO5iTp1ya Wu6dCfF00y7qPCcODZ0GG8JBaL9djnU6evsxdwN3D5afE9kGUms8XtRXz g==; X-CSE-ConnectionGUID: DP+S7Q0uReqF/AzleuyBjg== X-CSE-MsgGUID: dQO2uvN2RpuiIYCv4TPwLQ== X-IronPort-AV: E=McAfee;i="6600,9927,11054"; a="10160761" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="10160761" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 10:12:42 -0700 X-CSE-ConnectionGUID: Wp2JciT8RcaHkFoIjZ97Dg== X-CSE-MsgGUID: 9QAQkvcURkW0IXmb3EMnKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24819470" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 24 Apr 2024 10:12:42 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 24 Apr 2024 10:12:42 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 24 Apr 2024 10:12:42 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 24 Apr 2024 10:12:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CQTK2GEGZtXiAgB+dPUSiO8W8aEx1XVAzryll4tXJ8nA3gpg5ODyTptJ/sOP1jEAHIuvd2dokoEnfC73xgKbBkier0UnbwNndC84riCkurO5VltAB/gqx0mJuvwPoMO2AWxkui3vu0uh5zhfhU/AczaTIekz/pPPTs9+fUwY3zbTKaKQed1sogEJFc554T+Z22OaPxkvX2t5MnTWhZUG9jhjLxR5cVQe/yQ5yMINjeFLQByBGVmnDqL8joQ4JJhnKMPIe2yfLHm9HjPgA0mdomQ9SNnszbXaU5ly6YFMpmW8sVPIEmpQiV80qeTJI7soLFWqzMO+w4dRPbj8XMHawg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a0d/N3rRJUCrmTzbGNKS+490UXaZkR6gK2s8gLM7PoI=; b=jC0U00np+jLFOktF+3CedW2PUWwtI/3xAbV+XMHePXDOns4edkNe1St33rJjwdvEGkYy1nFLFVdvmX6UK897mQ+XZhh6V+2683Lg7AKgo7EcLZClNMg40p4vzJgPggYRhX+UqEiPMh1zmo8wW4H1dcCoCkfM4SB46gBC/iTIG52SzzhFjGw8FkyOMgBR673ZwHHXKJ9mExddJP5uIiVzTW+2SPy7SvCykRUpeTG/LVHZh+ofVGyrcG9yMnBQ8eG10laUp2VdqrTsJ+Xd0rOhNmb3M3CYCkRbUrEqrKj2mBjXGiXmdnEn3P3U1oPGMcp0yFc/G0sEDCiAGXT/J9Q80Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH8PR11MB6803.namprd11.prod.outlook.com (2603:10b6:510:1cb::12) by MW3PR11MB4523.namprd11.prod.outlook.com (2603:10b6:303:5b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.24; Wed, 24 Apr 2024 17:12:39 +0000 Received: from PH8PR11MB6803.namprd11.prod.outlook.com ([fe80::8680:ff9f:997:18b4]) by PH8PR11MB6803.namprd11.prod.outlook.com ([fe80::8680:ff9f:997:18b4%4]) with mapi id 15.20.7519.020; Wed, 24 Apr 2024 17:12:39 +0000 From: "Van Haaren, Harry" To: Stephen Hemminger CC: "dev@dpdk.org" , "Richardson, Bruce" , Jerin Jacob Subject: Re: [PATCH] event: fix warning from useless snprintf Thread-Topic: [PATCH] event: fix warning from useless snprintf Thread-Index: AQHalfnu0YkCa4sPI0ejm9ckWpMHS7F3GRtbgAB/vACAAAWXNQ== Date: Wed, 24 Apr 2024 17:12:39 +0000 Message-ID: References: <20240424034541.134335-1-stephen@networkplumber.org> <20240424091352.0eb5d141@hermes.local> In-Reply-To: <20240424091352.0eb5d141@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6803:EE_|MW3PR11MB4523:EE_ x-ms-office365-filtering-correlation-id: 87681dee-4bc4-4b22-cc9a-08dc6481bef6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?iso-8859-1?Q?qWlf89Bn4AKEqrTU7HyqBwSI0IYLhi6YgwXhQ/gny2aP5vdMEWDLCJfeiG?= =?iso-8859-1?Q?mkIs9ur6i2ua5ZxNSvC3fqioZP3HPGJPstLeSC//LlmInyri6ouPEOGp/e?= =?iso-8859-1?Q?/yRr9t/1K0nGN+XD1XOB1AkJ4hilZgNclgPhJM9xnedFruGxhtibnq9IpV?= =?iso-8859-1?Q?LKHDzJYG1gkBoVhV70dubDE3mt5BccGDRaNHo/j4uumzGANNfdnJ1G9wMy?= =?iso-8859-1?Q?csyt27DoP5MNPyaCmHUtXrcHDDf7VOMp4yJBU15ZKFI2d934oVazweynRt?= =?iso-8859-1?Q?gUoFBt/IEkhsiBYeCEDCJdUAec9u22pORB5wp02okwBcWVrpHAN2hBDM1d?= =?iso-8859-1?Q?96VbqxXRT073OOVXgPgi2oKotBsgZwDuaA3HTPy2/O3HAcCJt4cnoAT7+l?=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tsg9wFROrF/UTiwZbvuQPhnoROywDJ?= =?iso-8859-1?Q?ODsFSsiRCewKfemxL1A+byVNYw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH8PR11MB6803.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ci3VP9Safc3JryGmpl9PTOcBimugLAdj5CUTjQfHK+6mUMELhTFrBKc5qb?= =?iso-8859-1?Q?JzfZ64k79xP4iAk6wmOHTT2xWgDpb8ABNspEAaWD3qbXwmX3adZ6Mdnv2R?= =?iso-8859-1?Q?Y4WyqllkwZOs3Xa+Lz3GixdWMhNylHFmMQ8OoHl2o2fbu/9lS7xPeIbHXs?= =?iso-8859-1?Q?XYd8eZNzu73JlYwIJsupANCVwv5rDdAYAUPBke1cqgcWzeEo5SvnfMo9bi?= =?iso-8859-1?Q?zLA75qOSSTGk7pLc9v2rgsY42Ov7vqbXLjCEA8Ppsy2Vhp229akBozRRSX?= =?iso-8859-1?Q?0Aa96Oa5zQFxNayese/MSVH9adf9heh4r2yuG6l+cOaqkLnKNtNDuqMj0d?= =?iso-8859-1?Q?8+tz7jMM0IAB9harrXQb4bL2ebDuMUqyAEebUlMxYf19BSDGmrNHRhHvbO?= =?iso-8859-1?Q?lUqZP/CEkek2Cu64gVG6BSU7PNckrwXERzLx/2fQmkv/zJeyBBm6Dozn7t?= =?iso-8859-1?Q?sfmDmenK6SHfkQy2BHgX00fgJAc3lzWc4UacBTtMXTq4/bfl3OQUgwDfJQ?= =?iso-8859-1?Q?zW8IlXPXzbBM49gV8hOTUCbU3FOAbfQBCqKdJZhOtL6d19BHE5ZLYsnJ/h?= =?iso-8859-1?Q?YqXXLoafEmu8Q6jRX0AEZRkRqE3DwRlCHapxo0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qKOScB1STFvB24JCOPPV5jsIbs1I/40hmniri1YovrUieGsT?= =?iso-8859-1?Q?oJJhPMLW6eZmRyV2KYCditVKK55OVLuH6PK30Zzhx9vLQdpTnDq9T9N363?= =?iso-8859-1?Q?bL2P97Xn/ltZYe0CcH7Z5kreb+OWVaRSmM?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB6803.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87681dee-4bc4-4b22-cc9a-08dc6481bef6 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2024 17:12:39.6825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JvujymysB25OWBmLWMqdODMB8LjVJ/HyxzYdArRzYPripO7/i5iXD1fhxehwUT8ubGzYwc4Su1x1RB+oRzYP6Uy8l4LB9tsYHaAkYQzJP08= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4523 X-OriginatorOrg: intel.com 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 > ________________________________________=0A= > From: Stephen Hemminger =0A= > Sent: Wednesday, April 24, 2024 5:13 PM=0A= > To: Van Haaren, Harry=0A= > Cc: dev@dpdk.org; Richardson, Bruce; Jerin Jacob=0A= > Subject: Re: [PATCH] event: fix warning from useless snprintf=0A= > =0A= > On Wed, 24 Apr 2024 08:45:52 +0000=0A= > "Van Haaren, Harry" wrote:=0A= > =0A= > > > From: Stephen Hemminger =0A= > > > Sent: Wednesday, April 24, 2024 4:45 AM=0A= > > > To: dev@dpdk.org=0A= > > > Cc: Richardson, Bruce; Stephen Hemminger; Van Haaren, Harry; Jerin Ja= cob=0A= > > > Subject: [PATCH] event: fix warning from useless snprintf=0A= > > >=0A= > > > With Gcc-14, this warning is generated:=0A= > > > ../drivers/event/sw/sw_evdev.c:263:3: warning: 'snprintf' will always= be truncated;=0A= > > > specified size is 12, but format string expands to at least 13 [-= Wformat-truncation]=0A= > > > 263 | snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", = dev_id, i);=0A= > > > | ^=0A= > > >=0A= > > > Yet the whole printf to the buf is unnecessary. The type string argum= ent=0A= > > > has never been implemented, and should just be NULL. Removing the=0A= > > > unnecessary snprintf, then means IQ_ROB_NAMESIZE can be removed.=0A= > >=0A= > > I understand that today the "type" value isn't implemented, but across = the DPDK codebase it=0A= > > seems like others are filling in "type" to be some debug-useful name/st= ring. If it was added=0A= > > in future it'd be nice to have the ROB/IQ memory identified by name, li= ke the rest of DPDK components.=0A= > =0A= > No, don't bother. This is a case of https://en.wikipedia.org/wiki/You_are= n%27t_gonna_need_it=0A= =0A= I agree that YAGNI perhaps applied when designing the APIs, but the "type" = parameter is there now...=0A= Should we add a guidance of "when reworking code, always pass NULL as the t= ype parameter to rte_malloc functions" somewhere in the programmers guide, = to align community with this "pass NULL for type" initiative?=0A= =0A= =0A= =0A= Acked-by: Harry van Haaren =0A= =0A=