Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp183831ybl; Thu, 29 Aug 2019 21:12:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+n8tRVx4wFJYc1lwiJ0XbNiTh5AbT9uLHkNt9eQj2+uTrweWqYzcvWNFomapozEJJ3VLJ X-Received: by 2002:a17:90a:8981:: with SMTP id v1mr13462947pjn.136.1567138322812; Thu, 29 Aug 2019 21:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567138322; cv=none; d=google.com; s=arc-20160816; b=0ed0GUF7FjmAmTylbsd7/9D0I8dXks4ohttjNiSZrbSXD5VPgBpWP6A/xF/QFZmD5l y0isd2CTGslYPLm4mLVuJ8RnGRMYEGcq919RoGtDgQXdjSj1bDpsEnZEI4PAVU4JQn9q y5g3XQAKvD3ymjEgk97KC/c/1ahtX6of+1BChIkpf1bwtWEpbzl1uU9zBffbIJp0ULbF 8pfF3fR4zdkCQk8/1iOiHZTW+TlWd5In4JSpeEaURfwdmRQSzZVVIAtCb3D0xSG55wFT dJPGxcH5Dnycpymwxcen0dPPSsLDdOD1EoJLyc76zcAu5qC0VIz7DPiMQPCeTSwOsA12 AGfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0yJtfX+9yq2WALjnVV9WMqSNjtXPX48A2dPhnrYFm3A=; b=Q8wR7Z1lvHgZPm1kQOlq9IUP6D7nDD4fDtFPPsLso8nyfyZoJ2JCryg7gefhTHzjFB PkVXYSi/hYcMFpmeSscNAAY0BeucRDxoVZPa6oFazCxGalH0AiQ/Rm67l8exV4Cuk1w5 sqE7BbLo2c96z8WNICjhvCnOKfyIQDxCTHlLcfsnxHaMyb8BHpVU31npPPX0NscWv41t h2xJjOUI8xj/uWirFf0Y+uNpP9nGAdsxb/qUnPusoYtQYaPNq7T33IsEWWeQolsZNKUg zhjJ2/YaVRT3Sze+N6sLjuor5BAvWLeTRMiX2JPEWguru2ExTkyT97UFtkr1w49HpXb7 pGWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j126si4817860pfb.226.2019.08.29.21.11.46; Thu, 29 Aug 2019 21:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727133AbfH3EKw (ORCPT + 99 others); Fri, 30 Aug 2019 00:10:52 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42718 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725901AbfH3EKu (ORCPT ); Fri, 30 Aug 2019 00:10:50 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Aug 2019 07:10:46 +0300 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x7U4AiDA010368; Fri, 30 Aug 2019 07:10:45 +0300 From: Parav Pandit To: linux-kernel@vger.kernel.org, jiri@mellanox.com Cc: Parav Pandit Subject: [PATCH internal net-next 1/2] devlink: Make port index data type as unsigned int Date: Thu, 29 Aug 2019 23:10:34 -0500 Message-Id: <20190830041035.60581-2-parav@mellanox.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190830041035.60581-1-parav@mellanox.com> References: <20190830041035.60581-1-parav@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Devlink port index attribute is returned to users as u32 through netlink response. Change index data type from 'unsigned' to 'unsigned int' to avoid any size ambiguity and to avoid below checkpatch.pl warning. WARNING: Prefer 'unsigned int' to bare use of 'unsigned' 81: FILE: include/net/devlink.h:81: + unsigned index; Signed-off-by: Parav Pandit --- include/net/devlink.h | 2 +- net/core/devlink.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/net/devlink.h b/include/net/devlink.h index 7f43c48f54cd..13523b0a0642 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -75,7 +75,7 @@ struct devlink_port { struct list_head list; struct list_head param_list; struct devlink *devlink; - unsigned index; + unsigned int index; bool registered; spinlock_t type_lock; /* Protects type and type_dev * pointer consistency. diff --git a/net/core/devlink.c b/net/core/devlink.c index 650f36379203..b7091329987a 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -136,7 +136,7 @@ static struct devlink *devlink_get_from_info(struct genl_info *info) } static struct devlink_port *devlink_port_get_by_index(struct devlink *devlink, - int port_index) + unsigned int port_index) { struct devlink_port *devlink_port; @@ -147,7 +147,8 @@ static struct devlink_port *devlink_port_get_by_index(struct devlink *devlink, return NULL; } -static bool devlink_port_index_exists(struct devlink *devlink, int port_index) +static bool devlink_port_index_exists(struct devlink *devlink, + unsigned int port_index) { return devlink_port_get_by_index(devlink, port_index); } -- 2.19.2