diff mbox series

[18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API

Message ID 20200817080941.19227-19-allen.lkml@gmail.com (mailing list archive)
State New, archived
Headers show
Series crypto: convert tasklets to use new tasklet_setup() | expand

Commit Message

Allen Pais Aug. 17, 2020, 8:09 a.m. UTC
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/crypto/talitos.c | 42 ++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 23 deletions(-)

Comments

kernel test robot Aug. 17, 2020, 12:33 p.m. UTC | #1
Hi Allen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master rockchip/for-next v5.9-rc1 next-20200817]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Allen-Pais/crypto-convert-tasklets-to-use-new-tasklet_setup/20200817-161307
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: powerpc-mpc83xx_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/crypto/talitos.c: In function 'talitos1_done_4ch':
   drivers/crypto/talitos.c:407:33: error: implicit declaration of function 'from_tasklet' [-Werror=implicit-function-declaration]
     407 |  struct talitos_private *priv = from_tasklet(priv, t,  \
         |                                 ^~~~~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c:408:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c:408:3: note: each undeclared identifier is reported only once for each function it appears in
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos1_done_ch0':
   drivers/crypto/talitos.c:408:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:430:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     430 | DEF_TALITOS1_DONE(ch0, TALITOS1_ISR_CH_0_DONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos2_done_4ch':
   drivers/crypto/talitos.c:436:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     436 |   done_task[tasklet_idx]);    \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:457:1: note: in expansion of macro 'DEF_TALITOS2_DONE'
     457 | DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: At top level:
>> drivers/crypto/talitos.c:458:46: error: macro "DEF_TALITOS2_DONE" requires 3 arguments, but only 2 given
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         |                                              ^
   drivers/crypto/talitos.c:432: note: macro "DEF_TALITOS2_DONE" defined here
     432 | #define DEF_TALITOS2_DONE(name, ch_done_mask, tasklet_idx)  \
         | 
>> drivers/crypto/talitos.c:458:1: warning: data definition has no type or storage class
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         | ^~~~~~~~~~~~~~~~~
>> drivers/crypto/talitos.c:458:1: error: type defaults to 'int' in declaration of 'DEF_TALITOS2_DONE' [-Werror=implicit-int]
>> drivers/crypto/talitos.c:458:49: error: expected identifier or '(' before numeric constant
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         |                                                 ^
   drivers/crypto/talitos.c: In function 'talitos2_done_ch1_3':
   drivers/crypto/talitos.c:436:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     436 |   done_task[tasklet_idx]);    \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:460:1: note: in expansion of macro 'DEF_TALITOS2_DONE'
     460 | DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos_probe':
   drivers/crypto/talitos.c:3390:4: error: implicit declaration of function 'tasklet_setup' [-Werror=implicit-function-declaration]
    3390 |    tasklet_setup(&priv->done_task[0], talitos1_done_ch0);
         |    ^~~~~~~~~~~~~
>> drivers/crypto/talitos.c:3395:39: error: 'talitos2_done_ch0_2' undeclared (first use in this function); did you mean 'talitos2_done_ch1_3'?
    3395 |    tasklet_setup(&priv->done_task[0], talitos2_done_ch0_2);
         |                                       ^~~~~~~~~~~~~~~~~~~
         |                                       talitos2_done_ch1_3
>> drivers/crypto/talitos.c:3398:39: error: 'talitos2_done_ch0' undeclared (first use in this function); did you mean 'talitos1_done_ch0'?
    3398 |    tasklet_setup(&priv->done_task[0], talitos2_done_ch0);
         |                                       ^~~~~~~~~~~~~~~~~
         |                                       talitos1_done_ch0
   cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/0007edb339f5f9e0882f5503565ec00b1e835c03
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Allen-Pais/crypto-convert-tasklets-to-use-new-tasklet_setup/20200817-161307
git checkout 0007edb339f5f9e0882f5503565ec00b1e835c03
vim +/DEF_TALITOS2_DONE +458 drivers/crypto/talitos.c

   456	
   457	DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
 > 458	DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
   459	DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE, 0)
   460	DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
   461	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 7c547352a862..6d729af1f8e4 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -402,10 +402,11 @@  static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
  * process completed requests for channels that have done status
  */
 #define DEF_TALITOS1_DONE(name, ch_done_mask)				\
-static void talitos1_done_##name(unsigned long data)			\
+static void talitos1_done_##name(struct tasklet_struct *t)		\
 {									\
-	struct device *dev = (struct device *)data;			\
-	struct talitos_private *priv = dev_get_drvdata(dev);		\
+	struct talitos_private *priv = from_tasklet(priv, t,		\
+		done_task[0]);						\
+	struct device *dev = priv->dev;					\
 	unsigned long flags;						\
 									\
 	if (ch_done_mask & 0x10000000)					\
@@ -428,11 +429,12 @@  static void talitos1_done_##name(unsigned long data)			\
 DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
 DEF_TALITOS1_DONE(ch0, TALITOS1_ISR_CH_0_DONE)
 
-#define DEF_TALITOS2_DONE(name, ch_done_mask)				\
-static void talitos2_done_##name(unsigned long data)			\
+#define DEF_TALITOS2_DONE(name, ch_done_mask, tasklet_idx)		\
+static void talitos2_done_##name(struct tasklet_struct *t)		\
 {									\
-	struct device *dev = (struct device *)data;			\
-	struct talitos_private *priv = dev_get_drvdata(dev);		\
+	struct talitos_private *priv = from_tasklet(priv, t,		\
+		done_task[tasklet_idx]);				\
+	struct device *dev = priv->dev;					\
 	unsigned long flags;						\
 									\
 	if (ch_done_mask & 1)						\
@@ -452,10 +454,10 @@  static void talitos2_done_##name(unsigned long data)			\
 	spin_unlock_irqrestore(&priv->reg_lock, flags);			\
 }
 
-DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE)
-DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE)
-DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE)
-DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE)
+DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
+DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
+DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE, 0)
+DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
 
 /*
  * locate current (offending) descriptor
@@ -3385,23 +3387,17 @@  static int talitos_probe(struct platform_device *ofdev)
 
 	if (has_ftr_sec1(priv)) {
 		if (priv->num_channels == 1)
-			tasklet_init(&priv->done_task[0], talitos1_done_ch0,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos1_done_ch0);
 		else
-			tasklet_init(&priv->done_task[0], talitos1_done_4ch,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos1_done_4ch);
 	} else {
 		if (priv->irq[1]) {
-			tasklet_init(&priv->done_task[0], talitos2_done_ch0_2,
-				     (unsigned long)dev);
-			tasklet_init(&priv->done_task[1], talitos2_done_ch1_3,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_ch0_2);
+			tasklet_setup(&priv->done_task[1], talitos2_done_ch1_3);
 		} else if (priv->num_channels == 1) {
-			tasklet_init(&priv->done_task[0], talitos2_done_ch0,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_ch0);
 		} else {
-			tasklet_init(&priv->done_task[0], talitos2_done_4ch,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_4ch);
 		}
 	}