Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5884874pxb; Tue, 16 Feb 2021 09:52:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJynO5Id8l8pExRDwvJ6adiWQ1ioiOXxLbxOIJVaboabtkWuY9hYRKUsmhCKkdAj/HGfpply X-Received: by 2002:a05:6402:438d:: with SMTP id o13mr21775556edc.135.1613497959081; Tue, 16 Feb 2021 09:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613497959; cv=none; d=google.com; s=arc-20160816; b=hGSSH85/JgZrdSU3CjYWn1oPTPk8WpJLDBaAyY3WNxC+8E0nUK237ysPCW40xGwlp3 4alc+rCMzpih/wW8PFNUv8vyZzPd/UyoYJR6y/5kNblecp37exNQu0b8U1pBDv6UISsJ FweEJhfQTStsxDwHVd/qkIbnRAPcdGk3j1bBWbWXzDSkcYwTY4IUkD3KKVEF9KD2qJuS Nkl9NjRSN2I2y5g5A18VlBC6nwlLlujGHC2pxRyYOitlcPdjgmsIPoOMpSPLslZhSG48 56kISeFGZuXRNwN7a6QCAWH5N98DD46x6cKrqNHgqJfSJMm/oNpIbESVYruw2DHZuNkN ziiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S8W53c3cdWatdggZtp2ricu8jHA/FIygncsCF8Y1vLA=; b=t+wsoPI1t6+iYMVo8q/JR34dqfvWq3ge435AbOc1YjQ/6sFUF9SCxGlTDQOG6Qxrgn U37Bm/zLXEBpS6aJ7P3N7W0y///oIWX+nh4UCdbai3sdGk3nWWhpbneJGiQzc3lUUogP DwkMt2lpqmDqSJfdT6ACURhVQrLypZt0jmnAzZHlO+U385vPZfzPJu2Pru4Qv5d+/Gam h/eZu6tvMtiEdH0qSDgTJMCzS733xXQbtKpyPORtICL5iMjVtKOPDRpm13b4eusCm7id 8XDuGqEBRmo9ghO7r8pVNPed/0tIbIudfN+DqVmwGyELZ6XKmiLhbwDYcqFZ3OK1FHm/ nYkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfLxxktZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si15284974eds.116.2021.02.16.09.52.15; Tue, 16 Feb 2021 09:52:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfLxxktZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbhBPRti (ORCPT + 99 others); Tue, 16 Feb 2021 12:49:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:37514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbhBPRtO (ORCPT ); Tue, 16 Feb 2021 12:49:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B2A1964E04; Tue, 16 Feb 2021 17:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613497714; bh=+WmbEpL5TQzZgV2633H+PRBos/ZyurXcxG9Yaf/vsPY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PfLxxktZGpCdY6t+BB2FewXmei9MpsoKrwpECT6vHQbk+zd9Uqs2VxlTHtIMIwaxB KeeJXXvOHejzphs7KNQ0gX0UqUbwQKBd9VXeprmBGKV/qWUnE/9jk4a3apNfuzA0vU pmYVuuEjVIagD2SW0LzO1L7SjNaJ0eOUR9aRCUhg= Date: Tue, 16 Feb 2021 18:48:31 +0100 From: Greg Kroah-Hartman To: Maciej Kwapulinski Cc: Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: Re: [PATCH v1 12/12] gna: add a char device Message-ID: References: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com> <20210216160525.5028-13-maciej.kwapulinski@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210216160525.5028-13-maciej.kwapulinski@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2021 at 05:05:25PM +0100, Maciej Kwapulinski wrote: > +static inline struct gna_private *inode_to_gna(struct inode *inode) > +{ > + return container_of(inode->i_cdev, struct gna_private, cdev); > +} > + > +static int gna_open(struct inode *inode, struct file *f) > +{ > + struct gna_file_private *file_priv; > + struct gna_private *gna_priv; > + > + gna_priv = inode_to_gna(inode); > + if (!gna_priv) > + return -ENODEV; Why are you testing for things that is impossible to ever happen? Please go read your own function for proof... {sigh} greg k-h