Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1739832pxb; Fri, 27 Aug 2021 16:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUVkBoh1SZfAJAKVBozsTIoi/1gsavhb5yYGlddYzzPznJi6r8U8jA4tYX/p+FwvWucR6G X-Received: by 2002:a05:6402:40cf:: with SMTP id z15mr2942498edb.70.1630107753691; Fri, 27 Aug 2021 16:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630107753; cv=none; d=google.com; s=arc-20160816; b=ZlwdSGzMspDNNrHGd37+CbE77un5Rccy6ZaQI91k84tMwMK59GiQyKTcvNxeEywoef penLpmH20spY6Jdd97fG3VbQvAWqTnQ8ZuEbWHyjsvzYz2DMr9ft3HQT3LNnXPqbGBnq G2oxlat38RLK1EJMK/fwWOQ/EqjVjUs6xV1uDnG4iaZkm3DMpDbYPJvAcMuGhMDyUxfv Ar/9fH3AGWa2BPNsEHZBN3u34mIIPj1B+cH3wxgcNdoG0tmYSplHiKc0VxorIJq5N2pf /8Pqn45ZT/hdFh/c9pRYoZC4biwvd7eayTJOfcJtfKu2r8MM/gOKuGPHHv0GVKZlNqVR 4qpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=eEP9pOnPTRmzzXEkOuuw3aASMkcnu6gECOHCp9wM/sY=; b=oYJJX5ILJVXS/LI/1P09+Zlpuw4p2DeFykiN5/QAXEUeiAPl/CnJo3ek0mcGP1CYGb Km26iyS4Hv41QeT1VXhE5pUoMcg3uO7ua1bwvbyBErkpwDpB6PInZTnVBkq8iYvTAe3g lpU90Uotb5jaMxDtfwscTvu4atz3L+ztP0Cvwa6lyhT0rXTGs/Z7XWKs1YZMfDqhGeEs FC4AwU8o2ZkE+EFsVQH9zj56FpV+oKx+2pxYfyAaYub+1O3O5DSLkB1czrls898G2igU UtyclmvOl9gQm80hBpmkU9ka0pmoanlJPr3UKUZeO7vpxL9UQI8rfpPR4AzHSR+bnRde 1sLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bryanbrattlof.com header.s=protonmail header.b=rMp5gJUN; 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=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si8712997eje.719.2021.08.27.16.42.09; Fri, 27 Aug 2021 16:42:33 -0700 (PDT) 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=@bryanbrattlof.com header.s=protonmail header.b=rMp5gJUN; 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=REJECT sp=REJECT dis=NONE) header.from=bryanbrattlof.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbhH0Xjk (ORCPT + 99 others); Fri, 27 Aug 2021 19:39:40 -0400 Received: from mail-40136.protonmail.ch ([185.70.40.136]:50123 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232433AbhH0Xjj (ORCPT ); Fri, 27 Aug 2021 19:39:39 -0400 Date: Fri, 27 Aug 2021 23:38:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bryanbrattlof.com; s=protonmail; t=1630107528; bh=eEP9pOnPTRmzzXEkOuuw3aASMkcnu6gECOHCp9wM/sY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=rMp5gJUNs5kfgbMZrxvU0I88dfdyx2A9mzwg1axgDhsUQrSLMcRC+bVHlvcv2zfRp QLSQT3y1Y6Q74RlT+lQh1VcMU6Ti1oMpeFxvgE1UlJtjvunYpvzhA9+jSDzbZKjdfg gVc2+iS6wNfLv472wPQAjAe++N38BLwF3huuqMFI9IR1R3ijoa5LYKSEKtMBOZT2Bb NsjKQdC6wM9Czuc/CCVrX0dj482LW9Ji+zbJ9cJM0OjcNOat2M/uZSae2OCo92nS3C pOOnH/rFyf/mDi8xCjG0QePV2M8z/hEg5nwCWCU/Nl+i80XkVH8vyAR6GnOWKIZw+h yRCzSBrT/APxA== To: Krish Jain From: Bryan Brattlof Cc: "Fabio M. De Francesco" , gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Reply-To: Bryan Brattlof Subject: Re: [PATCH] Declare the file_operations struct as const Message-ID: <20210827233835.px4az5hyqks2n4o5@h510> In-Reply-To: References: <3634721.RBzQ2xsved@localhost.localdomain> <1742120.GgyQvu0Ciu@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krish! I'm sure someone has said something by now, however "top posting", where you reply to emails by writing on the top can make things hard to read on the mailing lists. The conversation is upside down when reading. https://en.wikipedia.org/wiki/Posting_style#Top-posting Next time try writing underneath the text your referring to like this: Don't worry we're all learning here :) On this day, August 27, 2021 thus sayeth Krish Jain: > I unfortunately forgot to add Greg to this thread. Doing so now. I > apologize for the confusion, if any. This patch was regarding the > staging tree's file android/ashmem.c and declaring the file_operations > struct as const as done elsewhere in the kernel, because there are no > modifications to its fields. > > Warm Regards > Things can be a little deceiving in the kernel. That's why testing your changes before you submit them can be helpful. But don't worry too much if you break something, there are countless bots trying to break the kernel every day. It usually means you're learning when you break something. > > On Fri, Aug 27, 2021 at 8:38 PM Krish Jain wro= te: > > > > So what do you think I can do? > > > > Best Regards > > That's a tough one as it really depends on your situation. When I first started programming I had a *really* old (even for that time) laptop that couldn't do much. It wasn't ideal but I found I could connect through ssh to a virtual machine my university lent me to "learn to code". I have no idea what your situation is like. Though having a second computer to compile code while I wrote worked for me. > > > > On Fri, Aug 27, 2021 at 10:50 AM Krish Jain = wrote: > > > > > > Hi, yes, this is my first time programming at this low level. And yes= , > > > I read both docs now. Furthermore the issue is that my current > > > hardware can't handle building the kernel, it barely managed to > > > survive the first build after 2 hours so I don't know how I can. If I > > > change it to static const would it fix the issue and build > > > successfully? If not what would be the error message, then I can > > > debug. Thanks > > > As for your patch, I built the driver using: $ make CCFLAGS=3D-Werror W=3D1 M=3Ddrivers/staging/android Which produced the following error: drivers/staging/android/ashmem.c: In function =E2=80=98ashmem_mmap=E2=80= =99: drivers/staging/android/ashmem.c:380:2: warning: =E2=80=98static=E2=80= =99 is not at beginning of declaration [-Wold-style-declaration] 380 | const static struct file_operations vmfile_fops; | ^~~~~ drivers/staging/android/ashmem.c:431:16: error: assignment of read-only var= iable =E2=80=98vmfile_fops=E2=80=99 431 | vmfile_fops =3D *vmfile->f_op; | ^ drivers/staging/android/ashmem.c:432:21: error: assignment of member = =E2=80=98mmap=E2=80=99 in read-only object 432 | vmfile_fops.mmap =3D ashmem_vmfile_mmap; | ^ drivers/staging/android/ashmem.c:433:34: error: assignment of member = =E2=80=98get_unmapped_area=E2=80=99 in read-only object 433 | vmfile_fops.get_unmapped_area =3D | ^ make[1]: *** [scripts/Makefile.build:271: drivers/staging/android/ashmem.o]= Error 1 make: *** [Makefile:1851: drivers/staging/android] Error 2 You shouldn't need to compile the entire kernel. That may be why your computer is having a hard time? Hope this helps :) and it was nice to meet you Krish ~Bryan