Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp886226imm; Mon, 9 Jul 2018 12:30:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfkE5rSAHg3fw0Z8BZKC0vbxvCasf5sOgb8BhN4EODtXy+fjAeT5x5fUgLXnXz1CytjuADe X-Received: by 2002:a65:630e:: with SMTP id g14-v6mr20219512pgv.153.1531164644114; Mon, 09 Jul 2018 12:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531164644; cv=none; d=google.com; s=arc-20160816; b=CVv/xJA8iFclCiU2GEGVhR5Z/JZxzJ9aQ9fGNBS6zkuXXqQOtu/XPnRST9Y5pkyeYs vHhORpfEjQb3QSHiQtuulTRYhf8EkrS2TZLDyc1IEKqJOZKwwuh/crotZhgS1WNG8xw+ eXwAbAdpwS+h2ohvWQ6WeyVyoPQYyQZiK2dpbMUMJAieDQhQMGJcaifSdax3TwodyF0b kfTAxmAEh7pk/zdie4j0ZAYzbxzrxm9olYPOglbRA0gmAZGKlYeDsvzvVhAf8wX3EfHm hm+EfiMK0V3gSIPqw/V8lQgO8gmsnTGRr6VUne6FdghGz/kZXdDu8zcZat0xAm9YlOli H28w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=epZgxKcg1ldwIJxVQOgtuOmT0In19i/OopvyYoShPPI=; b=OQDYN9oKbSxyoxzzDVX1o6n0LgQUQt6M2Z2TuVMKPInPylOiBpbiJiFs9cfyPmV40+ UQSc28smcIR0WCZSAle+xWpmmTw17PHD3h5zETahxZP1aM6Z8VXP4EzT/0UrJyTaJ3uf d6qGUpGgB04xJMN+Uzln/LtLrtjLSRcctomxLPIXHxEkx1wbo+tb2aByDT8uhqV2Gb6M 0JZj1oRJP5gve69vxrDj3xcBI3hp8V4zrkb2uyN2qeliY5PE1s1Em2l8+i3yGxLP61Fw TCdvsavPFj9cHTv+4te0x4f9iEbam1wYPkfpg8lw61kRiR0KmlMpCFgG2ejpRqwSTgVC 7EpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nCsE4kZ4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e64-v6si11126752pfj.63.2018.07.09.12.30.29; Mon, 09 Jul 2018 12:30:44 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=nCsE4kZ4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754569AbeGIT2Y (ORCPT + 99 others); Mon, 9 Jul 2018 15:28:24 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:54998 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754475AbeGIT2X (ORCPT ); Mon, 9 Jul 2018 15:28:23 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w69JNwAQ173539; Mon, 9 Jul 2018 19:28:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=epZgxKcg1ldwIJxVQOgtuOmT0In19i/OopvyYoShPPI=; b=nCsE4kZ4aAYs2mW3Zz4YyeEab437Sg90xdSgc2kmetmcrpVW2EYTHjShZn6oqtyo5zbQ QQY08fv0pGuS2WOwZNJUSOJDtmCZ2U8AK/CZZz1ek9yAc+ax5YAyEIU2oLY+9PxZwY37 zUlK3pkyKjt2Amiaa7RKUqWXRIaSLiA4/fRisDlV5MX+iZvKuWt9Ij/XjUVIOQCrl7f9 A3ThcGJKHzMaNuxVhxImUVwbIdVlEoaAr875Poeyg1Hbugkd0IW/hBHPG9SnIq8vnar6 Yb0jlApYFzvL05HDJNpMC0qtrVqCYGSlsrhhdLmQmlZvGsv/QlQ79nOe29Z2vv0PMGGa aw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2k2p7dnmbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jul 2018 19:28:18 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w69JSIs9018624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Jul 2018 19:28:18 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w69JSHcL028770; Mon, 9 Jul 2018 19:28:17 GMT Received: from mwanda (/197.157.34.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Jul 2018 12:28:17 -0700 Date: Mon, 9 Jul 2018 22:28:09 +0300 From: Dan Carpenter To: Ioana Radulescu Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, ioana.ciornei@nxp.com Subject: Re: [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check Message-ID: <20180709192809.msmwmtmgj4yxrhme@mwanda> References: <20180709150111.8875-1-ruxandra.radulescu@nxp.com> <20180709150111.8875-6-ruxandra.radulescu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180709150111.8875-6-ruxandra.radulescu@nxp.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8949 signatures=668705 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=919 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807090219 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 10:01:11AM -0500, Ioana Radulescu wrote: > @@ -2385,6 +2365,12 @@ static int netdev_init(struct net_device *net_dev) > > /* Set MTU upper limit; lower limit is 68B (default value) */ > net_dev->max_mtu = DPAA2_ETH_MAX_MTU; > + err = dpni_set_max_frame_length(priv->mc_io, 0, priv->mc_token, > + (u16)DPAA2_ETH_MFL); The cast was there in the original code so this is not a comment on this particular patch (which seems fine) but there is no need to cast. Generally it's best to avoid unnecessary casts. As a human reader, I find the cast confusing. It indicates that DPAA2_ETH_MFL somehow requires special handling. Perhaps it's negative or we are trying to truncate away the high bits. But neither of those things really make sense. From a static analysis perspective if DPAA2_ETH_MFL doesn't fit nicely then we would want to generate a warning. But the cast explicitly disables the check. regards, dan carpenter